0

私が試したこと:

   $url = str_replace(' ', '%20', trim($url));
    $percent = 1.0; 
    $imagethumbsize = 200;
    header('Content-type: image/jpeg');

    list($width, $height) = getimagesize($url);
    $new_width = $width * $percent;
    $new_height = $height * $percent;


    $image_p = imagecreatetruecolor($imagethumbsize , $imagethumbsize);  
    $image = imagecreatefromjpeg($url);

    imagecopyresampled($image_p, $image, -($new_width/2) + ($imagethumbsize/2), -($new_height/2) + ($imagethumbsize/2), 0, 0, $new_width , $new_width , $width, $height);
    $hel=imagejpeg($image_p,"E:".DS."xampp".DS."htdocs".DS."opg-uat".DS."img".DS."c".DS , 100);

私が得るエラー:「この画像にはエラーが含まれているため、保存できません」誰かが助けてください。

4

2 に答える 2

0

error.log に記録するか、これを php ファイルの先頭に追加してください:

error_reporting(E_ALL); ini_set('display_errors', '1');

すべてのエラーが表示されます。

于 2014-07-19T08:28:30.003 に答える