logo       

MagickReadImage() sets the image filename to a tmp filename: msg#00015

video.image-magick.bugs

Subject: MagickReadImage() sets the image filename to a tmp filename

Is the following code supposed to set the image filename?

magick_wand = NewMagickWand();
MagickReadImage( magick_wand, "./leaf.jpg" );
printf( "%s", MagickGetImageFilename( $magick_wand ) );

The above outputs something like, "/tmp/magick-XX7IsmFE" or some other tmp file
name (changes each
time the program is run).

Shouldn't the image filename either be the name of the original file the image
was read from (NOT
my first choice -- clobbering issues), or '\0' until the filename gets
explicitly set (or derived
from the wand filename, if there is one), when the image is to be written)?

The reason this is an issue is that in the PHP extension I have been
developing, I have
implemented code in the PHP function MagickWriteImages() that, (if join is
FALSE), checks each
image in a MagickWand (if any) for filename, and if it does not have one,
creates incremented
filenames based on either the filename argument, or (if no filename argument),
on the wand
filename.

So if the filename argument is './foo.jpg', and join is FALSE, and no images
have filenames in a 3
image wand, the image filenames created are supposed to be:

./foo_0.jpg
./foo_1.jpg
./foo_2.jpg

But with the images already having filenames (tmp filenames) due to the
MagickReadImage() call,
problems ensue, since I have constructed things to ensure that PHP's safe mode
rules are obeyed.

(Lost much sleep over this -- please help...)

OS: Linux
IM version: 6.1.0-8



__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise