Aborting on error

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
Eatloaf
Posts: 1
Joined: 2014-02-19T09:28:47-07:00
Authentication code: 6789

Aborting on error

Post by Eatloaf »

Hi,

Is there a way to prevent convert from writing an output file if it encounters such or any error?

I'm using the following to compress tiffs:

Code: Select all

find . -name "*.tif" -exec echo convert {} -compress ZIP {} \;
In the case of an error, such as

Code: Select all

convert: Cannot read TIFF header. `./image01.tif' @ error/tiff.c/TIFFErrors/561.
it still outputs a file of 0 bytes, effectively deleting the original tif.
Post Reply