Page 1 of 1

mogrify and convert

Posted: 2017-08-03T01:24:51-07:00
by UliW
Dear all,
I am about to convert a number of files which are all in C:\temp\bildbearbeitung
“test1”, “test2” …..

C:
cd \temp\bildbearbeitung
C:\Programme\ImageMagick-7.0.6-Q16\magick mogrify -path C:\temp\bildgroesse -resize 16% -compress LZW *.tif

I resize, compress and save them in another directory C:\temp\bildgroesse. It works well thanks to fmw42 and snibgo.

Now I want to change the name of the output file from “test1” to “test 1_org”, “test2” to “test2_org” and so on.

I tried in vain
C:
cd \temp\bildbearbeitung
C:\Programme\ImageMagick-7.0.6-Q16\magick mogrify -path C:\temp\bildgroesse -resize 16% -compress LZW -set filename:f %t_org %[filename:f].tif *.tif

I got the message: mogrify: unable to open image '%[filename:f].tif': No such file or directory @ error/blob.c/OpenBlob/3109.

Is it correct that mogify can not set filenames?
So I tried the convert command

cd \temp\bildbearbeitung
C:\Programme\ImageMagick-7.0.6-Q16\magick mogrify -path C:\temp\bildgroesse -resize 16% -compress LZW *.tif
cd \temp\bildgroesse
C:\Programme\ImageMagick-7.0.6-Q16\magick convert *.tif -compress LZW -set filename:f %t_org %[filename:f].tif

it works but only for the first file and blows it up (from 0.8 MB to 8 MB). By the way there is the same result for "filename:t %t_org %[filename:t]" and "filename:f %f_org %[filename:f]",

Am I right that mogrify can not use “set file name”? Why is the command line with the “convert -set filename” only working for the first file?
How to delete the old files “test1”, “test2” ….?

Thanks for your help
Uli

Re: mogrify and convert

Posted: 2017-08-03T01:35:04-07:00
by snibgo
Mogrify cannot change filenames.

"convert" works differently to "mogify".

Code: Select all

C:\Programme\ImageMagick-7.0.6-Q16\magick convert *.tif -compress LZW -set filename:f %t_org %[filename:f].tif
This command would read all your *.tif files, and write them into a single output tif file.

Re: mogrify and convert

Posted: 2017-08-03T02:03:50-07:00
by UliW
Thank you,
now I know why the one file is so big.
But what I should write instead and how to delete the files with the old name?

Thanks
Uli

Re: mogrify and convert

Posted: 2017-08-04T11:21:16-07:00
by UliW
Dear All,
at the end I managed to solve the problem.

Thanks
Uli

Re: mogrify and convert

Posted: 2017-08-04T12:11:04-07:00
by fmw42
Could you tell us what the problem was and how you solved it? That could help others later on.