Page 1 of 1

file name

Posted: 2018-12-03T15:49:28-07:00
by ifkey
Hello

I am using image magic for windows and I have a problem renaming a file.

Code: Select all

convert %1 -resize 636x1281^^! -density 300x300 c:\mock\temp\iphone_x.png
composite -compose Dst_In  -gravity center C:\mock\mask.png c:\mock\temp\iphone_x.png -alpha Set  c:\mock\temp\iphone_x.png
composite -geometry  +433+98 c:\mock\temp\iphone_x.png c:\mock\1.png C:\mock\done.png
composite -compose Screen C:\mock\done.png c:\mock\2.png C:\mock\Final.png
I need to rename the final.png to the name% 1 and add _1.jpg

exemple
%1 = zazpp
final.png rename to zazpp_1.jpg

please help))

Re: file name

Posted: 2018-12-03T15:55:35-07:00
by fmw42
I do not use Windows, so I cannot help answer your question. But please always provide your IM version when asking a question.

If you use convert ... composite rather than composite, then you should be able to write you several commands as one long command line. See https://imagemagick.org/Usage/compose/#compose

Re: file name

Posted: 2018-12-03T16:04:20-07:00
by ifkey
ImageMagick 7.0.8-10 Q16 x64 2018-08-14

Re: file name

Posted: 2018-12-03T16:06:52-07:00
by fmw42
With ImageMagick 7, you should use magick not convert and if you still want to use composite, then it should be magick composite. Syntax has changed a bit for IM 7.

Re: file name

Posted: 2018-12-03T16:36:03-07:00
by ifkey
please help)

Re: file name

Posted: 2018-12-03T16:49:29-07:00
by snibgo
I'm not sure I understand. Instead of "final.png", you can use "%1_1.jpg". Does that answer the question?