Title, such as the head of the station
But not everyone, my test is normal, but the customer, the first successful upload, the 23rd one failed, and the fourth is a smooth upload, this is how it happened
I put $_files print_r out all normal, but the place of the thumbnail is the 23rd one will be wrong, is there wrong, I ask you greatly.
$src_x = imagesx($src);$src_y = imagesy($src);if($src_x > $src_y){$s_thumb_x=250;$s_thumb_y = intval($src_y / $src_x * 250);$thumb_x = 600; $thumb_y = intval($src_y / $src_x * 600);}else{$s_thumb_y = 303;$s_thumb_x = intval($src_x / $src_y * 303);$thumb_y=904; $thumb_x = intval($src_x / $src_y * 904);}//第二三张时,这里会错误 $thumb = imagecreatetruecolor($thumb_x, $thumb_y);第二三张时,这里会错误//$sthumb = imagecreatetruecolor($s_thumb_x, $s_thumb_y);imagecopyresampled($thumb, $src, 0, 0, 0, 0, $thumb_x, $thumb_y, $src_x, $src_y);// 第二三张时,这里会错误imagecopyresampled($sthumb, $src, 0, 0, 0, 0, $s_thumb_x, $s_thumb_y, $src_x, $src_y);imagejpeg($thumb, $ofile);imagejpeg($sthumb, $sfile);
Reply content:
Title, such as the head of the station
But not everyone, my test is normal, but the customer, the first successful upload, the 23rd one failed, and the fourth is a smooth upload, this is how it happened
I put $_files print_r out all normal, but the place of the thumbnail is the 23rd one will be wrong, is there wrong, I ask you greatly.
$src_x = imagesx($src);$src_y = imagesy($src);if($src_x > $src_y){$s_thumb_x=250;$s_thumb_y = intval($src_y / $src_x * 250);$thumb_x = 600; $thumb_y = intval($src_y / $src_x * 600);}else{$s_thumb_y = 303;$s_thumb_x = intval($src_x / $src_y * 303);$thumb_y=904; $thumb_x = intval($src_x / $src_y * 904);}//第二三张时,这里会错误 $thumb = imagecreatetruecolor($thumb_x, $thumb_y);第二三张时,这里会错误//$sthumb = imagecreatetruecolor($s_thumb_x, $s_thumb_y);imagecopyresampled($thumb, $src, 0, 0, 0, 0, $thumb_x, $thumb_y, $src_x, $src_y);// 第二三张时,这里会错误imagecopyresampled($sthumb, $src, 0, 0, 0, 0, $s_thumb_x, $s_thumb_y, $src_x, $src_y);imagejpeg($thumb, $ofile);imagejpeg($sthumb, $sfile);
I can't afford to be big, I found the wrong place ....
$src of a line = @imagecreatefrompng ($_files[' Filedata ' ["tmp_name"]); Bugs