Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
you are right. I didn't notice that.
But what I'm looking for is how to rename files according to this pattern
foldername-001.jpg
foldername-002.jpg
foldername-003.jpg
I still can't understand how to do this.
When I execute this code
Some experimentation shows that %d is taken from the filename as given to IM, not from the file's actual location. As $f doesn't include a directory, that's the problem.
mogrify.exe: unable to open image `%[filename:mysize]': No such file or directory @ error/blob.c/OpenBlob/2709.
mogrify.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
mogrify will not accept such set computations. It is much less functional than convert. You probably will need to write a script loop over each of your images and use convert. What was your exact mogrify command, so we can check your syntax.
I don't see how it could work in mogrify. Mogrify reads files, and writes files with the same name. The %[filename...] syntax builds an output filename from some data. How can mogrify read a file before it knows what the name is?