Fix image jpg upload

This commit is contained in:
champsupertramp
2016-04-06 11:24:11 +08:00
parent 800d9d86e0
commit 6df0e1bfed
+2 -2
View File
@@ -616,8 +616,8 @@ class UM_Files {
if ( $info['mime'] == 'image/jpeg' ){
$thumb = imagecreatetruecolor( $size, $height );
imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h );
$thumb_s = imagecreatefromjpeg( $source );
imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h );
imagejpeg( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext, 100);
}else if ( $info['mime'] == 'image/png' ){
$thumb_s = imagecreatefrompng( $source );
@@ -628,8 +628,8 @@ class UM_Files {
imagepng( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext );
}else if ( $info['mime'] == 'image/gif' ){
$thumb = imagecreatetruecolor( $size, $height );
imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h );
$thumb_s = imagecreatefromgif( $source );
imagecopyresampled( $thumb, $thumb_s, 0, 0, 0, 0, $size, $height, $w, $h );
imagegif( $thumb, $this->upload_basedir . $user_id . '/' . $name . '-' . $size . $ext);
}
}