PHP Classes

File: example.split.php

Recommend this page to a friend!
  Classes of Christian Vigh   PHP TIFF Split and Merge   example.split.php   Download  
File: example.split.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP TIFF Split and Merge
Split and merge multipage TIFF images
Author: By
Last change:
Date: 7 years ago
Size: 776 bytes
 

Contents

Class file image Download
<?php
   
/******************************************************************************************

        This example takes a multipage TIFF file (example.tif) and extracts all its
        pages to page.0.tif up to page.x.tif.

        To properly run this example, you need an existing multipage tif file called
        'images/multipage.tif'.

        You can get the example images here :

        https://github.com/christian-vigh-phpclasses/TiffTools

     ******************************************************************************************/

   
require_once ( 'TiffSplitter.phpclass' ) ;

   
$tiff = TiffSplitter::Load ( 'images/multipage.tif' ) ;

    foreach (
$tiff as $page )
       {
       
$output = 'page.' . $page -> PageNumber . '.tif' ;
       
$page -> SaveTo ( $output ) ;
        }