downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Imagick::getOption> <Imagick::getIteratorIndex
Last updated: Fri, 27 Nov 2009

view this page in

Imagick::getNumberImages

(PECL imagick 2.0.0)

Imagick::getNumberImagesReturns the number of images in the object

Description

int Imagick::getNumberImages ( void )
Warning

This function is currently not documented; only its argument list is available.

Returns the number of images associated with Imagick object.

Return Values

Returns the number of images associated with Imagick object. Throw an ImagickException on error.



add a note add a note User Contributed Notes
Imagick::getNumberImages
gzabriskie at yahoo dot com
07-Apr-2009 12:21
<?php
/* Create the object */
$image = new Imagick('YourImageLocation.tif');
$count = $image->getNumberImages();

echo
"<h3 style=\"font: bold 12pt Arial\">Total Number of Images Extracted ".
    
"from the TIF : ".$image->getNumberImages()."</h3>";

for (
$x = 1;$x <= $image->getNumberImages(); $x++) {
 
$image->previousImage();
 
$image->thumbnailImage( 400, null );
 
$image->writeImage('img'.$count.'.png');
 
$count--;
}
?>

<html>
  <head>
    <title>Extracting Images Form TIFF</title>
  </head>
  <body>
    <table cellspacing="10" style="background: #ddd"><tr>
      <?php
     
for ($x = 1;$x <= $image->getNumberImages(); $x++) {
        echo
"<td><img src=\"img$x.png\"<br /><p style=\"font: bold 12pt Arial;".
            
"text-align: center\">image $x (png)</p></td>";
      }
     
?>
    </tr></table>
  </body>
</html>

Imagick::getOption> <Imagick::getIteratorIndex
Last updated: Fri, 27 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites