我收到此错误
imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error:
每次我尝试上传照片。我用它好几个月,从来没有问题,现在突然我明白了。
我尝试了不同的照片,并在磁盘上释放空间,但没有。
private function watermark($destination, $name, $path){
$im = imagecreatefromjpeg($path);
$stamp = imagecreatefrompng(public_path('/watermark.png'));
$marge_right = 50;
$marge_bottom = 50;
$fixed_width = 768;
$fixed_height = 531;
$rate_x = $fixed_width/imagesx($im);
$rate_y = $fixed_height/imagesy($im);
$sx = imagesx($stamp);
$sy = imagesy($stamp);
imagecopyresized($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0,imagesx($stamp)/$rate_x, imagesy($stamp)/$rate_y, imagesx($stamp), imagesy($stamp));
header('Content-type: image/jpeg');
imagejpeg($im, $destination.'/'.$name);
imagedestroy($im);
}
请帮帮我。这让我发疯了。