Hi Everyone,
Is there a way to prevent Mogrify from exiting with code 1 if there's a problem with one of the files and exception is thrown so it can continue processing the rest of the files? For example we use command like:
magick mogrify -format jpg -thumbnail 1000x1000 -gravity center -background white *
but if one of the files is mp4 the following exception is thrown:
<event>2019-02-15T12:41:24-08:00 0:00.260 0.156u 7.0.7 Exception mogrify[4932]: constitute.c/ReadImage/509/Exception
no decode delegate for this image format `'</event>
Is there a way to prevent the whole process from quitting if one of the files is "bad"?
Thanks you
Prevent Mogrify from exiting upon exception
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Prevent Mogrify from exiting upon exception
I do not think you can prevent it from quitting with an exception. But to process mp4, I believe that you need to install ffmpeg as a delegate to Imageamgick. That might then be able to prevent that specific situation. You can also tell mogrify to process certain file types and that way keep it from dealing with mp4. Replace * with *.jpg for example.
Code: Select all
magick mogrify -format jpg -thumbnail 1000x1000 -gravity center -background white *.jpg *.png *.tif