1 | <?php |
||
17 | abstract class Basic |
||
18 | { |
||
19 | /** |
||
20 | * Image GD |
||
21 | * |
||
22 | * @var resource |
||
23 | */ |
||
24 | protected $img; |
||
25 | /** |
||
26 | * Image Height |
||
27 | * |
||
28 | * @var int |
||
29 | */ |
||
30 | protected $imgHeight = 0; |
||
31 | /** |
||
32 | * Image Width |
||
33 | * |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $imgWidth = 0; |
||
37 | |||
38 | /** |
||
39 | * @return int height of the image in pixels |
||
40 | */ |
||
41 | 2 | public function getHeight() |
|
45 | |||
46 | /** |
||
47 | * @return int Number of bytes to represent a row of this image |
||
48 | */ |
||
49 | 1 | public function getHeightBytes() |
|
53 | |||
54 | /** |
||
55 | * @return int Width of the image |
||
56 | */ |
||
57 | 1 | public function getWidth() |
|
61 | |||
62 | /** |
||
63 | * @return int Number of bytes to represent a row of this image |
||
64 | */ |
||
65 | 1 | public function getWidthBytes() |
|
69 | |||
70 | /** |
||
71 | * getDimImage |
||
72 | * Get width and height of resource image |
||
73 | * and save in properties |
||
74 | * |
||
75 | * @return array with dimentions of image |
||
76 | */ |
||
77 | 9 | public function getDimImage() |
|
85 | |||
86 | /** |
||
87 | * @return boolean True if GD is supported, false otherwise (a wrapper for the version, for mocking in tests) |
||
88 | */ |
||
89 | 12 | protected function isGdSupported() |
|
93 | |||
94 | /** |
||
95 | * @return boolean True if GD is loaded, false otherwise |
||
96 | */ |
||
97 | 12 | protected function isGdLoaded() |
|
102 | |||
103 | /** |
||
104 | * identifyImg |
||
105 | * Identifies image file type |
||
106 | * |
||
107 | * @param string $filename |
||
108 | * @return string |
||
109 | */ |
||
110 | 8 | protected function identifyImg($filename) |
|
134 | } |
||
135 |