Skip to content

Commit

Permalink
Merge pull request blueimp#1152 from naxhh/master
Browse files Browse the repository at this point in the history
Prevent js crash on orient_image = true
  • Loading branch information
blueimp committed Apr 3, 2012
2 parents ea5b386 + 7b4acb9 commit e5589a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/php/upload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ protected function trim_file_name($name, $type) {
}

protected function orient_image($file_path) {
$exif = exif_read_data($file_path);
$exif = @exif_read_data($file_path);

if ($exif === false) { //if not exif exists, we don't need to continue
return false;
}

$orientation = intval(@$exif['Orientation']);
if (!in_array($orientation, array(3, 6, 8))) {
return false;
Expand Down

0 comments on commit e5589a2

Please sign in to comment.