Command Line help controlling output name and folder
Posted: 2012-05-04T11:38:14-07:00
Hi,
I just started using ImageMagick-6.7.6-Q16 for creating thumbnails for large numbers of images.
I've been struggling though trying to get the "convert" and/or "mogrify" commands to output to folders and filenames that i want.
I have sort of gotten the results that i want by using "convert" but i'm having issues w/ that due to it crashing after running out of memory, i realize "mogrify" would be much preferable to use since it opens up each image one at a time - but mogrify doesn't like to use the "-set" flag which i've found necessary to get the output filename that i desire. I also need the thumbnails in a subfolder of the image's folder.
I'm calling convert like this currently (where my command is run in the subfolder where i want the output images to go)...
C:\ImageFolder\thumbs\convert "C:\ImageFolder\*.tga" -format png -thumbnail 64x64 -set filename:orig %f %[filename:orig].png
or
C:\ImageFolder\thumbs\convert @"C:\ImageFolder\createThumbs.txt" -format png -thumbnail 64x64 -set filename:orig %f %[filename:orig].png
So my questions:
1) is there a way for me to use mogrify and get the output filename to be the input file name w/ original ext plus the new ext. such as "blah.tga" would output to "blah.tga.png"
2) when calling convert or mogrify where i use a txt file to specify the files to convert, is there a way to get each individual output image to go to a subfolder of it's source image. such as i have images c:\FolderA\testA.tga and c:\FolderB\testB.tga listed in the txt file. i would want the output to be c:\FolderA\thumbs\testA.tga.png and c:\FolderB\thumbs\testB.tga.png
I'm currently limiting how many files i pass through to "convert" as a workaround for the memory issue, but that's a hack.
Some people may suggest other workarounds by using a batch file, but i'm limited w/ what i can do in that respect due to the fact that i'm calling these commands from another program and am limited in how i can call the command line from there.
Thanks for any help,
I just started using ImageMagick-6.7.6-Q16 for creating thumbnails for large numbers of images.
I've been struggling though trying to get the "convert" and/or "mogrify" commands to output to folders and filenames that i want.
I have sort of gotten the results that i want by using "convert" but i'm having issues w/ that due to it crashing after running out of memory, i realize "mogrify" would be much preferable to use since it opens up each image one at a time - but mogrify doesn't like to use the "-set" flag which i've found necessary to get the output filename that i desire. I also need the thumbnails in a subfolder of the image's folder.
I'm calling convert like this currently (where my command is run in the subfolder where i want the output images to go)...
C:\ImageFolder\thumbs\convert "C:\ImageFolder\*.tga" -format png -thumbnail 64x64 -set filename:orig %f %[filename:orig].png
or
C:\ImageFolder\thumbs\convert @"C:\ImageFolder\createThumbs.txt" -format png -thumbnail 64x64 -set filename:orig %f %[filename:orig].png
So my questions:
1) is there a way for me to use mogrify and get the output filename to be the input file name w/ original ext plus the new ext. such as "blah.tga" would output to "blah.tga.png"
2) when calling convert or mogrify where i use a txt file to specify the files to convert, is there a way to get each individual output image to go to a subfolder of it's source image. such as i have images c:\FolderA\testA.tga and c:\FolderB\testB.tga listed in the txt file. i would want the output to be c:\FolderA\thumbs\testA.tga.png and c:\FolderB\thumbs\testB.tga.png
I'm currently limiting how many files i pass through to "convert" as a workaround for the memory issue, but that's a hack.
Some people may suggest other workarounds by using a batch file, but i'm limited w/ what i can do in that respect due to the fact that i'm calling these commands from another program and am limited in how i can call the command line from there.
Thanks for any help,