PHP Classes

File: Operation/Interlace.php

Recommend this page to a friend!
  Classes of Pablo Matias Perrone   Interlace class for WideImage   Operation/Interlace.php   Download  
File: Operation/Interlace.php
Role: Class source
Content type: text/plain
Description: Source file
Class: Interlace class for WideImage
Set the interlace flag of a WideImage object
Author: By
Last change: Added throw error when an error occurs.
Date: 10 years ago
Size: 718 bytes
 

Contents

Class file image Download
<?php
  
/**
     * This file is NOT a part of WideImage.
     * @author Matias Perrone
     * @copyleft 2013
     * @package Internal/Operations
    **/

    /**
     * Interlace operation class
     *
     * @package Internal/Operations
     */
   
class WideImage_Operation_Interlace
   
{
       
/**
         * Returns a interlaced image
         *
         * @param WideImage_Image $img
         * @param boolean $interlace
         * @return WideImage_Image
         */
       
function execute($img, $interlace = true)
        {
           
$new = $img->copy();
           
$interlace = ($interlace ? true : false);
            if (!
imageinterlace($new->getHandle(), $interlace))
                    throw new
WideImage_GDFunctionResultException("imageinterlace() returned false");
            return
$new;
        }
    }