PHP Doku:: Returns the number of images in the object - function.imagick-getnumberimages.html

Verlauf / Chronik / History: (50) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzBildverarbeitung und -generierungImage Processing (ImageMagick)The Imagick classImagick::getNumberImages

Ein Service von Reinhard Neidl - Webprogrammierung.

The Imagick class

<<Imagick::getIteratorIndex

Imagick::getOption>>

Imagick::getNumberImages

(PECL imagick 2.0.0)

Imagick::getNumberImagesReturns the number of images in the object

Beschreibung

int Imagick::getNumberImages ( void )
Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung.

Returns the number of images associated with Imagick object.

Rückgabewerte

Returns the number of images associated with Imagick object. Wirf eine ImagickException bei einem Fehler.


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
gzabriskie at yahoo dot com
7.04.2009 14: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>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)