in reply to How to create JPEG of specified size

Does the fake have to be a valid JPEG file, or just a file whose name ends with .jpg? The latter would be particularly easy to do.

If you want to produce a valid JPEG of a certain size, you play with the quality setting. It's trial an error. The amount of colours in the image will have an impact. You could also add JFIFEXIF tags to the image to increase its size.

Update: JFIF is the .jpg file format. EXIF is what the tags are called.

Replies are listed 'Best First'.
Re^2: How to create JPEG of specified size
by Limbic~Region (Chancellor) on Jul 25, 2007 at 16:39 UTC
    ikegami,
    Yes, a valid JPEG that is relatively close in filesize to the original. If you have code that exercises the trial and error or the JFIF EXIF tags I would be most appreciative.

    Cheers - L~R

      Sorry, I don't. In fact, Image::Magick would ignore the quality setting when I tried to use it in the (distant) past.