Reference Manuals

Scale

Scale — Scale the image

Scale is part of the Gallery package.

Synopsis

class Scale implements Transform {
        private        int                 $height
        private        int                 $width

        public         Scale               __construct               ( int $width,
                                                                       int $height );
        public         resource            apply                     ( resource $image,
                                                                        &$image );
}

Object Hierarchy

Scale

Implemented Interfaces

Scale implements Transform

Description

Scale the image

Scale the image so it will fit in the given width and height. Aspect ratio is always maintained. If with or height is zero then it will be calculated. When both are zero the image is passed on unchanged.

Attribute Details

$height

private        int            $height

The height of the image after resizing

Default value: empty string


$width

private        int            $width

The width of the image after resizing

Default value: empty string

Method Details

__construct()

public         Scale          __construct               ( int $width,
                                                          int $height );

Create a new Scale transform

$width
$height

apply()

public         resource       apply                     ( resource $image,
                                                           &$image );

Apply the Scale transform to the image

$image
&$image