Do not convert based on file name

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
rforgo

Do not convert based on file name

Post by rforgo »

Hello all,

I'm running ImageMagick-6.3.7-Q16 on a W2K3 server. We have PDFs being generated from our InDesign server and IM is converting them to JPEGs as they arrive (we're using WatchDirectory to monitor the folder for new arrivals and it fires a batch script when it sees a new arrival). But some of these PDFs are multipage files that don't need to be converted to JPEGs. Our InDesign guys are flagging these files with a file name that ends in "_999.pdf". Is there a way to have IM recognize such file names and ignore the conversion?

If so, how would I write that in the batch file? The current script looks like this:

"C:\Program Files\ImageMagick-6.3.7-Q16\convert.exe" "%WD_FILE%" -resize 20%% "%WD_FILE_D%%WD_FILE_B%.jpg"

Any help is appreciated.
rforgo

Re: Do not convert based on file name

Post by rforgo »

OK, so this is not possible?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Do not convert based on file name

Post by anthony »

It is not posible in IM. But in the API scripts using IM it is posible,

For exampel from the command line you can look over the images, and tell it not to convert those with a "_999.pdf" suffix

For example...

Code: Select all

   find *.pdf  \! -name "*_999.pdf" | xargs  mogrify -format .jpg
That is just ONE method there a lots of techniques!
Similar methods are present for perl, php, and any other API language.

Essentially it is not a IM problem, but a API problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply