Skip to content

Commit

Permalink
Stream: Fixed the error of "File not supported" with exif checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ichk committed May 31, 2024
1 parent cafb7b4 commit a9f6707
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ v28.0.00
Bug Fixes
Admissions: fixed "Do not include a second parent" being accidentally checked by default
Messenger: fixed error redirect for New Message sending users to a non-existing page
FileUploader: fixed the error shown when the FileUploader did an exif data check for some images

v27.0.00
--------
Expand Down
6 changes: 3 additions & 3 deletions src/Gibbon/FileUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function uploadAndResizeImage($file, $filenameChange = '', $maxSize = 102
}

$this->resizeImage($file['tmp_name'], $file['tmp_name'], $maxSize, $quality);

return $this->uploadFromPost($file, $filenameChange);
}

Expand Down Expand Up @@ -350,8 +350,8 @@ public function resizeImage($sourcePath, $destPath, $maxSize = 1024, $quality =
imagecopyresampled($dst, $src, $destX, $destY, $srcX, $srcY, $destWidth, $destHeight, $srcWidth, $srcHeight);

// Handle Exif rotation
if (function_exists('exif_read_data')) {
$exif = exif_read_data($sourcePath);
if (function_exists('exif_read_data') && in_array($extension, ['jpg', 'jpeg'])) {
$exif = @exif_read_data($sourcePath);
if (!empty($exif['Orientation'])) {
switch ($exif['Orientation']) {
case 3:
Expand Down

0 comments on commit a9f6707

Please sign in to comment.