Thumbnail creation in spite of memory allocation failure

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?".
Post Reply
grazzman
Posts: 1
Joined: 2013-09-07T00:54:33-07:00
Authentication code: 6789

Thumbnail creation in spite of memory allocation failure

Post by grazzman »

Hello,

when the convert throws an error "memory allocation failed", the "thumbnail-100x100.jpg" will still be created with the original size (e.g. 8000 x 2000)

Code: Select all

convert -resize 100x100 -quality 100 reallybigimage-8000x2000.jpg thumbnail-100x100.jpg
Is there an option, which prevents creating the file?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Thumbnail creation in spite of memory allocation failure

Post by fmw42 »

convert -resize 100x100 -quality 100 reallybigimage-8000x2000.jpg thumbnail-100x100.jpg
I do not know about the question you ask, but you IM syntax is not proper for IM 6 though still may work. The input image should be read first if not a vector format.

convert reallybigimage-8000x2000.jpg -resize 100x100 -quality 100 thumbnail-100x100.jpg

see
http://www.imagemagick.org/Usage/basics/#why


You may also want to see the -define jpg:size at
http://www.imagemagick.org/Usage/formats/#jpg_read
Post Reply