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!
-limit not working
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -limit not working
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
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
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?
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?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: -limit not working
"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.convert -limit area 128mb ...
(This is on v6.8.7-0 on Windows 7.)
snibgo's IM pages: im.snibgo.com
Re: -limit not working
I tried. But that doesn't seem make any difference...
Re: -limit not working
Try
- convert -limit area 128MB -list resource
Re: -limit not working
It gives:
convert: invalid argument for option '128MB' : -limit
convert: invalid argument for option '128MB' : -limit
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: -limit not working
What version are you running? On what platform?
snibgo's IM pages: im.snibgo.com
Re: -limit not working
fmw42 wrote: try leaving off the mb
These together provides some information which moves me to the next question:magick wrote:Try
It should return an area limit of 128MB. If so, ImageMagick is behaving as expected.
- convert -limit area 128MB -list resource
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?
Tried on 6.5.6 and 6.8.2 on RedHatsnibgo wrote:What version are you running? On what platform?