forked from leftypol/leftypol
DefaultImageFormatReader.php: GdImageFormatReader isn't from gd
This commit is contained in:
parent
a1aefc0d6b
commit
cd8d93ad05
1 changed files with 1 additions and 1 deletions
18
inc/Service/Media/DefaultImageFormatReader.php
Normal file
18
inc/Service/Media/DefaultImageFormatReader.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
namespace Vichan\Service\Media;
|
||||
|
||||
|
||||
class DefaultImageFormatReader implements ImageFormatReader {
|
||||
/**
|
||||
* getimagesize() is agnostic of any image metadata.
|
||||
* If e.g. the Exif Orientation flag is set to a value which rotates the image by 90 or 270 degress, index 0 and 1
|
||||
* are swapped, i.e. the contain the height and width, respectively.
|
||||
*/
|
||||
public function getSizes(string $file_path): array {
|
||||
$ret = \getimagesize($file_path);
|
||||
if ($ret === false) {
|
||||
throw new \RuntimeException("Could not read image sizes of '$file_path'");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue