Prev
MagickWand For PHP
Manual


Next

MagickWriteImages

MagickWriteImages -- writes a MagickWand's image sequence to a file or files

Description

bool MagickWriteImages( MagickWand mgck_wnd [, string filename [, bool join_images]] )

Writes a MagickWand's image sequence to a file or files. If the optional join_images parameter is TRUE, (it is FALSE by default), the function attempts to write all the images in the MagickWand's image list to a single multi-image file. This functionality depends on whether the MagickWand's format, at the time of the MagickWriteImages() call, supports multi-image images (like "GIF"). If the format does not, only the first image in the MagickWand's image list (index 0) is written to the file. The file-writing scheme used in this case is as follows: 1) if the filename parameter to the function evaluates to other than "" (empty string), the image will be written to that filename; 2) if the filename parameter evaluates to "" (empty string), and the MagickWand's filename evaluates to other than "", the image will be written to the filename indicated by the MagickWand's filename; 3) if both the filename parameter and the MagickWand's filename evaluate to "" (empty string), a fatal error will occur and script execution will halt. If the optional join_images parameter is FALSE (the default), then all the images in the MagickWand will be written to individual files. The file-writing scheme used in this case is as follows: 1) if the filename parameter to the function evaluates to other than "" (empty string), the images will be written to files named as follows: [MagickGetNumberImages( $mgck_wnd ) === 15] MagickWriteImages( $mgck_wnd, './imgfile.gif' ) -- join_images is FALSE by default -- creates ./imgfile_00.gif ./imgfile_01.gif ./imgfile_02.gif ... ./imgfile_13.gif ./imgfile_14.gif Note the "_00", etc. inserted into the filenames before the period. This is to ensure aplhabetical order in the file naming. The inserted numbers will be auto numbered and zero filled, depending on how many images are contained in the MagickWand. For example, if MagickGetNumberImages( $mgck_wnd ) === 1567, then the above files would be named ./imgfile_0001.gif ./imgfile_0002.gif ./imgfile_0003.gif ... ./imgfile_1565.gif ./imgfile_1566.gif 2) if the filename parameter evaluates to "" (empty string), and the MagickWand's filename is set to other than "", then the MagickWand's filename will be used as the written filename base, in the same fashion as above (#1). 3) if both the filename parameter and the MagickWand's filename evaluate to "", then each image is written to it's individual filename. No auto-numbering is done, so if two image's filenames are the same, the image with a higher index in the MagickWand's image list, will overwrite the one with a lower index. 4) if the filename parameter, the MagickWand's filename, and any individual image's filename all evaluate to "" (empty string), a fatal error occurs, and script execution terminates. NOTE: In the preceeding function description, whether an image is actually written to any filename, depends on whether the filename obeys all of PHP's filesystem security restrictions (open_basedir, safe_mode, etc.). If any of the filenames mentioned below do not obey PHP's restrictions, a fatal error will occur, and script execution will halt.


A description of each parameter follows:

mgck_wnd A MagickWand resource
filename (OPTIONAL) "" (empty string) by default.
Specifies the filename images are to be written to.
If not specified or if it evaluates to the empty string, the MagickWand's filename or the individual images' filenames (in that order) are used as the filenmame which wil be written to (see description above).
join_images (OPTIONAL) FALSE by default.
Specifies whether to join the MagickWand's images into a single multi-image image file.
The MagickWand's format must allow this (e.g. "GIF"), or else only the first image in the MagickWand (index 0) will be written to the file


Prev
MagickWriteImageFile
Up Next
MagickWriteImagesFile