Only JPEG files (and TIFF, which we don't support) have EXIF
This commit is contained in:
parent
bf8c26f835
commit
ca67e848eb
@ -76,9 +76,10 @@ class ImageFile
|
|||||||
$this->width = ($info) ? $info[0]:$width;
|
$this->width = ($info) ? $info[0]:$width;
|
||||||
$this->height = ($info) ? $info[1]:$height;
|
$this->height = ($info) ? $info[1]:$height;
|
||||||
|
|
||||||
|
if ($this->type == IMAGETYPE_JPEG) {
|
||||||
// Orientation value to rotate thumbnails properly
|
// Orientation value to rotate thumbnails properly
|
||||||
$exif = exif_read_data($this->filepath);
|
$exif = exif_read_data($this->filepath);
|
||||||
if (isset($exif['Orientation'])) {
|
if (is_array($exif) && isset($exif['Orientation'])) {
|
||||||
switch ((int)$exif['Orientation']) {
|
switch ((int)$exif['Orientation']) {
|
||||||
case 1: // top is top
|
case 1: // top is top
|
||||||
$this->rotate = 0;
|
$this->rotate = 0;
|
||||||
@ -96,6 +97,7 @@ class ImageFile
|
|||||||
// If we ever write this back, Orientation should be set to '1'
|
// If we ever write this back, Orientation should be set to '1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function fromFileObject(File $file)
|
public static function fromFileObject(File $file)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user