Page is a not externally linkable
- Code, Content, and Presentation
-- Site Graphics and Multimedia Design
---- create a JPG with precise filesize. how?


rocknbil - 4:02 pm on Jun 18, 2009 (gmt 0)


I'm polishing up a feature that lets a user upload a photo.

I'm guessing PHP based. Not sure about the GD toolkit, but Imagick/ImageMagick allows you to set the compression level. What I'd do is set a maximum display size (say 600 px width) then do some math against the compression so it equals +- 3MB. Or work it backwards; 3MB/$compression = (w X h).


Thread source:: http://www.webmasterworld.com/graphics_multimedia/3935347.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com