Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
My users upload hundreds of jpg images every day and the maximum allowed file size is 4 MB. Warning emails I receive maybe2-10 times per day but I think it's not normal that Imagemagick sometimes needs 386 MB and more memory to resize one jpg image < 4 MB.
What do you suggest to limit memory usage? What is the correct way to do this? Like this:
serv5:/usr/bin# which imagemagick
serv5:/usr/bin# whereis imagemagick
imagemagick:
serv5:/usr/bin#
serv5:/usr/bin# apt-get install imagemagick
Reading package lists... Done
Building dependency tree
Reading state information... Done
imagemagick is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
serv5:/usr/bin#
serv5:/usr/bin# which convert
/usr/bin/convert
serv5:/usr/bin#
For JPEG to make a image that is just less than 4MB it actually has to save that image multiple times at different quality settings until it finds on that is just under that limit.
Better method. Just check input image size, if the image is too big.. warn user!
But also Use a fixed compression quality, and limit pixel size for input image.
A short trial with very complex test images should give you a rough idea what image size limits should be.
Users understand pixel size limits... they really do not understand compression limits.