2

I need to save a bunch (several thousand) of images with imagemagick.

I'm totally new to it, and its documentation seems totally opaque and totally labyrinth. Where's the quickstart guide?

Looking at it, I think I want to use mogrify.

so I cd to my program files directory where I installed imagemagick.

I run mogrify -format png *.png as I see in various examples.

It says:

mogrify: unable to open image `fgimg\': No such file or directory @ blob.c/OpenB
lob/2489.
mogrify: unable to open file `fgimg\' @ png.c/ReadPNGImage/2865.

How do I instruct it to run on all images in the subdirectory \fgimg?

Thanks a lot!

2
  • It's not clear how you need to process the images. Your example command takes all png images and overwrites them with images in the same format: png. Commented Jun 18, 2009 at 1:38
  • Yes, that's all I need to do. Saving them again with imagemagick fixes problems inherent in those files. I described the problem here: stackoverflow.com/questions/1007496/a-batch-gimp-png-script Thanks! Commented Jun 18, 2009 at 2:03

1 Answer 1

8

The problem here is that you're hitting the limit of how much you can put on a command line. You need to split it into chunks that will fit. This should work better:

find -name '*.png' -print0 | xargs -0 -r mogrify -format png

The -print0 and -0 are used to handle spaces in filenames, and the -r means don't run mogrify if there's nothing to do.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.