Passing filename as argument to program for MagickWriteImage

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
Atirag
Posts: 6
Joined: 2012-03-28T13:35:51-07:00
Authentication code: 8675308

Passing filename as argument to program for MagickWriteImage

Post by Atirag »

Hello, I'm trying to pass the filename of an image as argument to my program and use it with MagickReadImage and then to re-write the image with MagickWriteImage.

When I print the argument the path is fine

Code: Select all

  printf("argv 5 %s\n",argv[5]);
gives
argv 5 ../Imagenes/Clase 1/barleyrice001-inca-100dpi-00.png
Which is the correct path. When I do

Code: Select all

status=MagickReadImage(image_wand,argv[5]);
There's no error. Bu when I do

Code: Select all

status=MagickWriteImage(MagickGetImage(image_wand),argv[5]);
I get this
wand/magick-image.c:12753: MagickWriteImage: Assertion `wand != (MagickWand *) ((void *)0)' failed.
Any idea what could be happening? I used the same code but passing the name of the image not from program arguments and it gave me no problem.
Post Reply