I tried to convert a number of files like this:
convert -size 660x580 -depth 8 "C:\path...\*.jpg" "C:\path...\%d.png"
path... is the path to the file location.
For example, there's 2 file, 1.jpg and 2.jpg,
after conversion, the file would be named d-1.png and d-2.png.
Why is "d-" added to the file name? How do i remove or prevent it?
Thanks.
*additional info: this problem only happen when the command is in a windows batch file. If i type in the command manually into command prompt, i could get 1.png and 2.png as the output file name.
have prefix in output file name
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: have prefix in output file name
That suggests that the problem is in the interpretation of the percent sign. I think in a batch file you have to double the percent.this problem only happen when the command is in a windows batch file
Try this sort of thing:
Code: Select all
convert -size 660x580 -depth 8 "C:\path...\*.jpg" "C:\path...\%%d.png"
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: have prefix in output file name
Hi el-supremo, thanks for the help. It works fine after doubling the percent.
Thanks.
Thanks.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: have prefix in output file name
For more information about using IM under Windows Batch files, see
Im Exmaples, APIs, Windows
http://www.imagemagick.org/Usage/api/#windows
Special thinks to Wolfgang Hugemann for his re-write of this section of IM examples.
Im Exmaples, APIs, Windows
http://www.imagemagick.org/Usage/api/#windows
Special thinks to Wolfgang Hugemann for his re-write of this section of IM examples.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/