class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
Basically, the class tries to compress the images with a quality of 25, 50 and 75, and then calculates the rapport between the resulting file sizes and the wanted size, attempting to find the best quality to match the wanted size.
So if the three attempts are not linear, its estimation may be off, thus resulting in a wrong quality and filesize. If you could send me examples of the pictures that get it wrong, as well as your settings, I can try to tweak the code.Reply
What images give you a 150Ko size?
------------------------------------------
Very difficult to to say : some respect the jpeg_size rule and some never do that. Why ?
So if the three attempts are not linear, its estimation may be off, thus resulting in a wrong quality and filesize. If you could send me examples of the pictures that get it wrong, as well as your settings, I can try to tweak the code.