Page 1 of 1

ImageMagick stripping filenames

Posted: 2007-10-05T04:16:05-07:00
by mkoppanen

Code: Select all

#include <stdio.h>
#include <string.h>

#include <wand/magick-wand.h>

int main ()
{
        MagickWandGenesis();

        MagickWand *magick_wand;
        magick_wand = NewMagickWand();

        MagickReadImage( magick_wand, "a%%b.jpg" );
        MagickWriteImage( magick_wand, "a%%c.jpg" );

        magick_wand = (MagickWand *)DestroyMagickWand( magick_wand );

        MagickWandTerminus();

        return 0;
}
The resulting image filename on the disk is a%c.jpg. Is this intended behavior?

Re: ImageMagick stripping filenames

Posted: 2007-10-05T06:47:48-07:00
by magick
ImageMagick permits an embedded formatting character in the filename to accept the image scene number. Protect any % characters in your filename by prefixing any % with another % (e.g. a%%%%b.jpg).

Re: ImageMagick stripping filenames

Posted: 2007-10-05T06:50:23-07:00
by mkoppanen
Ah, ok!

Thank you for your reply!