logo       

Download link RE:MagickWriteImageFile() does not obey MagickSetImageFormat(: msg#00019

video.image-magick.bugs

Subject: Download link RE:MagickWriteImageFile() does not obey MagickSetImageFormat() format change; seems to only write image in original image format

Just read that ImageMagick mailing lists do not allow attachments, so here is
link to bugtest
source archive:

http://magnus.dreamhost.com/magickwand/bugtests.tar.bz2

.............................................

I have written a program which demonstrates this behavior, but it is a bit
larger than the usual
fare, so above is a link to an archive which contains it, and the sample images
used:

The following describes the problem in detail, and the results of the program.

/*
* bugtest.c
*
* General bug testing/demo program written by Ouinnel Watson on 2004-10-13
*
* Current bug: MagickWriteImageFile() does not obey MagickSetImageFormat()
format
* change; seems to only write image in original image format.
*
* WARNING: this program as it is now creates 36 image files; recommend that
you put
* it in its own directory before running it.
*
* Problem: MagickWriteImageFile() is integral to the PHP extension currently
under
* development, as it is used to do (most of) the image file writing
in the
* extension.
* A php_stream * is opened on the specified file, and, if successful,
is cast
* to a FILE *, which is then passed onto MagickWriteImageFile().
* This is done in order to ensure that PHP's safe mode, openbasedir,
etc., file
* restriction rules are obeyed, as there is no stat()-like call in
the PHP API
* which would give you that information.
* Since a manual does-this-filename-follow-the-rules check would be
redundant,
* when the php_stream_open_wrapper() function does it for you, and
the result
* can be cast to a FILE *, for easy supply to MagickWriteImageFile(),
the
* MagickWriteImageFile() function has been heavily relied upon in the
* extension.
* So, MagickWriteImageFile() needs to work as expected.
*
* Demo: The following program creates MagickWands from several images, and
proceeds to:
* 1) change their formats to GIF, JPEG, MIFF, and PNG;
* 2) opens (writeable) FILE * filehandles on files named as follows
* "imgfile.ext_writeimagefile.FORMAT" ("imgfile.ext" would be the
original
* image's name), for each format listed above, and does
* MagickWriteImageFile() for each FILE * opened;
* 3) does MagickWriteImages() (with adjoin as both MagickTrue and
MagickFalse) to
* files named as follows
* "imgfile.ext_writeimages_BOOL.FORMAT", (eg:
"tux.jpg_writeimages_TRUE.PNG"),
* depending on the value of adjoin and the image format, for each
format
* listed above.
*
* Results: If you look at the results, ("ls -l *writeimagefile*" on the
commandline will
* do it), you will see that the various *writeimagefile.FORMAT files
will have
* identical sizes, when grouped by their original names, but
different formats,
* while "ls -l *writeimages*" on the commandline shows that the
various
* *writeimages_BOOL.FORMAT files have sizes that vary according to
the formats
* chosen.
* And, if you look at all the files with an "ls -lS" on the
commandline, you
* will see that all the *writeimagefile* files are all bunched
together with
* identical filesizes, and identical original image filenames, but
different
* formats.
*
* Not only are the sizes identical, but the FILES themselves are
identical, all
* written in whatever the original format was! What
MagickSetImageFormat()
* "did" seems to be ignored, when MagickWriteImageFile() gets called!
*
* Last Update: 2004-10-14 @ 02:57 (AM) EST
*/




_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


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

News | FAQ | advertise