summaryrefslogtreecommitdiffstats
path: root/src/exceptions/unsupported_image_type.php
blob: 333e06fa37add90f23d606755a7b870ff1a46829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
 * File containing the ezcGraphGdDriverUnsupportedImageTypeException class
 *
 * @package Graph
 * @version //autogen//
 * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */
/**
 * Exception thrown if the image type is not supported and therefore could not
 * be used in the gd driver.
 *
 * @package Graph
 * @version //autogen//
 */
class ezcGraphGdDriverUnsupportedImageTypeException extends ezcGraphException
{
    public function __construct( $type )
    {
        $typeName = array(
            1 => 'GIF',
            2 => 'Jpeg',
            3 => 'PNG',
            4 => 'SWF',
            5 => 'PSD',
            6 => 'BMP',
            7 => 'TIFF (intel)',
            8 => 'TIFF (motorola)',
            9 => 'JPC',
            10 => 'JP2',
            11 => 'JPX',
            12 => 'JB2',
            13 => 'SWC',
            14 => 'IFF',
            15 => 'WBMP',
            16 => 'XBM',

        );

        if ( isset( $typeName[$type] ) )
        {
            $type = $typeName[$type];
        }
        else
        {
            $type = 'Unknown';
        }

        parent::__construct( "Unsupported image format '{$type}'." );
    }
}

?>
OpenPOWER on IntegriCloud