Hi guys,
I could really use som help with this...
I have a huge archive of images, some of them contain clipping paths - and some don't. Want I want is a command line that will process clipping when a path is present - and when it is not --> to continue with the rest of the parameters and complete the operation (without throwing an error).
This command line works fine for images with clip paths...
convert image.tif -alpha transparent -clip -alpha opaque -strip -resize 800x800 -background white -flatten image.jpg
However, when this command line encounters images without clip paths, then it throws an error ("no clip path defined `image.tif': No such file or directory @ error/image.c/ClipImagePath/719") and the operation fails.
Does anyone know of a way around this?
Cheers,
Kare
Clipping paths
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Clipping paths
Your script could catch this error and run an alternative command. Or it could run "identify -verbose" first to determine whether a clip path is present.
snibgo's IM pages: im.snibgo.com
Re: Clipping paths
I'm using IM through an external tool connector from a DAM system and can only pass "one liners" to IM..snibgo wrote:Your script could catch this error and run an alternative command. Or it could run "identify -verbose" first to determine whether a clip path is present.
Example:
C:\Program Files\ImageMagick-6.9.0-Q16\convert.exe $INPUT -alpha transparent -clip -alpha opaque -strip -resize 800x800 -background white -flatten $OUTPUT.jpg
How can I pass an "if statement" and run alternate commands if a clip path is not present?
I would be very greatful for any tips.
Cheers,
Kare
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Clipping paths
I don't know what a DAM system is.
If it can't run a script, and can only run a binary program, then you could write a program, a customised version of convert. It would either ignore that particular error, or do one of the actions I mentioned above.
If it can't run a script, and can only run a binary program, then you could write a program, a customised version of convert. It would either ignore that particular error, or do one of the actions I mentioned above.
snibgo's IM pages: im.snibgo.com