ImageMagick stripping filenames

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

ImageMagick stripping filenames

Post 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?
Mikko Koppanen
My blog: http://valokuva.org
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick stripping filenames

Post 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).
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: ImageMagick stripping filenames

Post by mkoppanen »

Ah, ok!

Thank you for your reply!
Mikko Koppanen
My blog: http://valokuva.org
Post Reply