Skip to content
Permalink
Browse files Browse the repository at this point in the history
check image create errors.
  • Loading branch information
m1k1o committed Jan 6, 2022
1 parent 5e1a72f commit 6f5e59f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/image.class.php
Expand Up @@ -110,15 +110,16 @@ private static function thumb($source_path, $thumb_path){
}

$old_image = $imgcreatefrom($source_path);
if ($old_image === false) return false;

$new_image = imagecreatetruecolor($new_w, $new_h);
imagecopyresampled($new_image, $old_image, 0, 0, 0, 0, $new_w, $new_h, $source_w, $source_h);

$new_image = self::fix_orientation($source_path, $new_image);
$old_image = self::fix_orientation($source_path, $old_image);

$imgt($new_image, $thumb_path);
$imgt($old_image, $source_path);
return true;
return $imgt($new_image, $thumb_path)
&& $imgt($old_image, $source_path);
}

public static function upload(){
Expand Down

0 comments on commit 6f5e59f

Please sign in to comment.