lucajackal85 /
ImageMerge
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Jackal\ImageMerge\Utils; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * Class ImageUtils |
||
| 7 | * @package Jackal\ImageMerge\Utils |
||
| 8 | */ |
||
| 9 | class ImageUtils |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @param $filePathName |
||
| 13 | * @return int |
||
| 14 | */ |
||
| 15 | public static function getImageWidth($filePathName) |
||
| 16 | { |
||
| 17 | return self::getImageDimensions($filePathName)[0]; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param $filePathName |
||
| 22 | * @return int |
||
| 23 | */ |
||
| 24 | public static function getImageHeight($filePathName) |
||
| 25 | { |
||
| 26 | return self::getImageDimensions($filePathName)[1]; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param $filePathName |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | private static function getImageDimensions($filePathName) |
||
| 34 | { |
||
| 35 | return getimagesize($filePathName); |
||
|
0 ignored issues
–
show
|
|||
| 36 | } |
||
| 37 | } |
||
| 38 |
If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.