To reduce the size of JPEG image file, usually the image is saved with lower quality compression factor.
However, using this method it is not guaranteed that the size of the resulting image file will be smaller than a given size limit.
JPEG Reducer is a class that solves this problem by trying different quality to determine the ideal compression ratio to reduce image to the target limit size just by specifying that limit value in class variable.
This class can be used in public photo gallery to make sure all images are have acceptable size. |