Page 1 of 1
-limit not working
Posted: 2013-12-02T19:18:28-07:00
by buncee
Hi,
I've been blocked on this for a whole day. Really need some help or idea.
I run the command:
convert -limit area 128mb -limit map 256mb -limit disk 512mb -format %w,%h, <inputFile> -identify <outputFile>
It give the error: Could not read file as specified mime-type, file is invalid or corrupted: Illegal Argument Exception, bailing out: Could not read file as type 'image/gif' or 'image/jpeg', Not a JPEG file: starts with 0xff 0xd9
However, when I remove the three -limit argument and run only
convert -format %w,%h, <inputFile> -identify <outputFile>
It convert successfully.
Why is this?
I've also tried change the limit to smaller or bigger value and even tried change mb to MB or MiB(though I don't think that is the problem) but no luck.
Please hlep! Thanks!
Re: -limit not working
Posted: 2013-12-02T19:35:52-07:00
by fmw42
try
identify -ping -format "%w,%h" yourimage
or
convert yourimage -ping -format "%w,%h" info:
or
convert -limit memory 32 -limit map 32 yourimage -ping -format "%w,%h" info:
see
http://www.imagemagick.org/script/resou ... nvironment
http://www.imagemagick.org/script/comma ... .php#limit
http://www.imagemagick.org/Usage/files/#massive
if you use a disk limit, it will give an error message if you exceed the limit
try leaving off the mb
Re: -limit not working
Posted: 2013-12-02T23:54:19-07:00
by buncee
Thank you. But it doesn't solve my problem
If I'm not specifying a disk limit will there be any problem?
When it gives the error, is that because the disk limit (512mb) is too small? But I think it wouldn't take much space to process image, right? What is a proper value for disk size, e.g. 2 times max acceptable size? What about other limit value?
Any insight?
Re: -limit not working
Posted: 2013-12-03T00:53:21-07:00
by snibgo
convert -limit area 128mb ...
"MB" is case-sensitive and should be in capitals. I suspect that "mb" is ignored, so it tries to fit the image in 128 bytes.
(This is on v6.8.7-0 on Windows 7.)
Re: -limit not working
Posted: 2013-12-03T02:15:36-07:00
by buncee
I tried. But that doesn't seem make any difference...
Re: -limit not working
Posted: 2013-12-03T03:31:17-07:00
by magick
Try
- convert -limit area 128MB -list resource
It should return an area limit of 128MB. If so, ImageMagick is behaving as expected.
Re: -limit not working
Posted: 2013-12-03T10:57:03-07:00
by buncee
It gives:
convert: invalid argument for option '128MB' : -limit
Re: -limit not working
Posted: 2013-12-03T12:02:19-07:00
by snibgo
What version are you running? On what platform?
Re: -limit not working
Posted: 2013-12-03T15:35:34-07:00
by buncee
fmw42 wrote:
try leaving off the mb
magick wrote:Try
- convert -limit area 128MB -list resource
It should return an area limit of 128MB. If so, ImageMagick is behaving as expected.
These together provides some information which moves me to the next question:
when I run:
convert -limit map area 128 -limit map 256 -limit disk 512 -list resource
it gives:
File Area Memory Map Disk
-----------------------------------------------------------------------------
2.6e+02mb 1.3e+02mb 5.1e+02gb
It seems IM has default unit for different resource(Area in mb, Map in mb and Disk in gb)? Any way to make disk limit down to 512mb?
snibgo wrote:What version are you running? On what platform?
Tried on 6.5.6 and 6.8.2 on RedHat