Method for determining whether a sealing area of a primary packaging container for an ophthalmic lens, for example a contact lens such as a soft contact lens, is unacceptable for properly sealing a foil to the sealing area that completely surrounds an opening of a bowl of the primary packaging container, with the bowl containing a liquid, the method comprising the steps of - taking an infrared image of the primary packaging container using an infrared camera; - determining in the infrared image a plurality of individual pixels which are arranged along an area corresponding to the sealing area of the primary packaging container, the plurality of individual pixels together covering at least 80 % of the area corresponding to the sealing area; - determining from the infrared image the temperature (T 0, T 1, T 2) of the individual pixels, and - determining that the sealing area of the primary packaging container is unacceptable for properly sealing the foil thereto in case the following conditions are fulfilled: a) the temperature (T 1) of each individual pixel of a predetermined number of individual pixels (700, 703, 706) arranged directly adjacent to one another to form a continuous area of pixels is lower than a reference temperature (T 0), and b) the difference between the temperature (T 1) of each individual pixel (700; 703; 706) of the predetermined number of individual pixels (700, 703, 706) arranged directly adjacent to one another to form a continuous area of pixels and the reference temperature (T 0) exceeds a predetermined threshold. - taking an infrared image of the primary packaging container using an infrared camera; - determining in the infrared image a plurality of individual pixels which are arranged along an area corresponding to the sealing area of the primary packaging container, the plurality of individual pixels together covering at least 80 % of the area corresponding to the sealing area; - determining from the infrared image the temperature (T 0, T 1, T 2) of the individual pixels, and - determining that the sealing area of the primary packaging container is unacceptable for properly sealing the foil thereto in case the following conditions are fulfilled: a) the temperature (T 1) of each individual pixel of a predetermined number of individual pixels (700, 703, 706) arranged directly adjacent to one another to form a continuous area of pixels is lower than a reference temperature (T 0), and b) the difference between the temperature (T 1) of each individual pixel (700; 703; 706) of the predetermined number of individual pixels (700, 703, 706) arranged directly adjacent to one another to form a continuous area of pixels and the reference temperature (T 0) exceeds a predetermined threshold. a) the temperature (T 1) of each individual pixel of a predetermined number of individual pixels (700, 703, 706) arranged directly adjacent to one another to form a continuous area of pixels is lower than a reference temperature (T 0), and b) the difference between the temperature (T 1) of each individual pixel (700; 703; 706) of the predetermined number of individual pixels (700, 703, 706) arranged directly adjacent to one another to form a continuous area of pixels and the reference temperature (T 0) exceeds a predetermined threshold.