I would like to rename files with ImageMagick and save them in C:\index\pictures.

The new file name should consist of the old one (without extension) + org.

I wrote the command line:

C:\Programme\ImageMagick-7.0.6-Q16\magick mogrify -path C:\index\pictures -set filename:f “%%t_org” *.tif

but there is no change of the output file name. What went wrong?

Thanks you for your answers, I tired convert *.tif -set filename:f %t_org %[filename:f].tif and it wors well, but I need to rename all images separatly and "convert" put them all together in one file.

  • Try putting the -Path as a different director than the one the source files are in like a new sub directory you create beneath. I don't have time to test and write a script now but start with using a different path with the -Path option to start for a potential simple solution. – Pimp Juice IT Aug 2 '17 at 17:29
  • Tag me back with a reply for an update on this. – Pimp Juice IT Aug 2 '17 at 23:09

According to documentation, mogrify modifies files by overwriting while convert creates a copy.

This tool is similar to convert except that the original image file is overwritten (unless you change the file suffix with the -format option) with any changes you request.

To create new files with your naming scheme and using convert:

convert *.tif -set filename:f '%t.org' '%[filename:f].tif'

This command creates new files in current working directory with filename appended by .org.

  • Thank you for your answer. But I need to rename a lot of files wich are all in one directory. – UliW Aug 3 '17 at 12:10
  • If you only want to rename, perhaps you should consider another tool (such as rename on windows technet.microsoft.com/en-us/library/bb490987.aspx ). – sebasth Aug 3 '17 at 12:12
  • test1.tif to test1_org.tif; when I am using cd \temp\bildgroesse rename C:\temp\bildgroesse* *_org it ends with Test2.tif_org – UliW Aug 3 '17 at 12:45
  • rename *.tif *_org.tif – sebasth Aug 3 '17 at 12:50
  • (I have tried before) the same result: test1.tif_org.tif – UliW Aug 3 '17 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.