Using Input file name as part of the Output 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Using Input file name as part of the Output file name

Post by anthony »

There are a number of ways but none are truely IM specific. Most involve generating the name externally in a shell script. Or mogrify the images into a different 'temporary' directory, then using other programs to rename and move the results back to the current directory with the desired name.

I myself created my own thumbnailing scripts to do the task.

Before that I used mogrify to save to a different file format (JPG for the origina limage, and GIF for the thumbnail) then used a renaming script ("mved", or "mv_perl" availabel on the WWW) to add the appropriate thumbnail naming conventions.

Sorry, there is no simple solution to this. But I suggest you pick a convention that works for you and stick to it. You can then slowly create script to work to that convention.

You can also find such scripts such as PhotoMagick or other photo album applications.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply