File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ public function __construct($filename)
81
81
82
82
case IMAGETYPE_JPEG :
83
83
$ this ->source_image = $ this ->imageCreateJpegfromExif ($ filename );
84
-
84
+
85
85
// set new width and height for image, maybe it has changed
86
86
$ this ->original_w = ImageSX ($ this ->source_image );
87
87
$ this ->original_h = ImageSY ($ this ->source_image );
88
-
88
+
89
89
break ;
90
90
91
91
case IMAGETYPE_PNG :
@@ -99,16 +99,16 @@ public function __construct($filename)
99
99
100
100
return $ this ->resize ($ this ->getSourceWidth (), $ this ->getSourceHeight ());
101
101
}
102
-
102
+
103
103
// http://stackoverflow.com/a/28819866
104
104
public function imageCreateJpegfromExif ($ filename ){
105
105
$ img = imagecreatefromjpeg ($ filename );
106
- $ exif = exif_read_data ($ filename );
107
-
106
+ $ exif = @ exif_read_data ($ filename );
107
+
108
108
if (!$ exif || !isset ($ exif ['Orientation ' ])){
109
109
return $ img ;
110
110
}
111
-
111
+
112
112
$ orientation = $ exif ['Orientation ' ];
113
113
114
114
if ($ orientation === 6 || $ orientation === 5 ){
@@ -122,7 +122,7 @@ public function imageCreateJpegfromExif($filename){
122
122
if ($ orientation === 5 || $ orientation === 4 || $ orientation === 7 ){
123
123
imageflip ($ img , IMG_FLIP_HORIZONTAL );
124
124
}
125
-
125
+
126
126
return $ img ;
127
127
}
128
128
You can’t perform that action at this time.
0 commit comments