ここには本当に別の頭脳が必要です。画像の3つの異なるバージョンを作成し、それらを異なるフォルダー(大、中、サムネイル)に保存するスクリプトがあります。サイズを変更してフォルダに配置しますが、大きい方は読み取りできません(他の2つは読み取り可能です)。それはフォルダとは何の関係もないので、私は立ち往生しています...
これが私の(簡略化された)コードです:
<?php
$target_folder = "images/";
$uploads_dir = $target_folder;
$upload_image = $_FILES['Filedata']['tmp_name'];
$id = $_POST['post_id'];
$image_name = $id . "." . time(); //this just generates the image name
$large_name = $target_folder . "large/" . $image_name . ".jpg";
$medium_name = $target_folder . "medium/" . $image_name . ".jpg";
$small_name = $target_folder . "small/" . $image_name . ".jpg";
list($width, $height) = getimagesize($upload_image); //width/height of original image
$medium_newwidth = $width * 0.60; //scales image down to 60%
$medium_newheight = $height * 0.60;
$small_newwidth = $width * 0.20; //scales image down to 20%
$small_newheight = $height * 0.20;
$large = imagecreatefromjpeg($upload_image); //here's where I think the problem might be
$medium = imagecreatetruecolor($medium_newwidth, $medium_newheight);
$small = imagecreatetruecolor($small_newwidth, $small_newheight);
imagecopyresized($medium, $large, 0, 0, 0, 0, $medium_newwidth, $medium_newheight, $width, $height);
imagecopyresized($small, $large, 0, 0, 0, 0, $small_newwidth, $small_newheight, $width, $height);
imagejpeg($medium, $medium_name, 100);
imagejpeg($small, $small_name, 100);
rename($upload_image, $large_name);
?>
何か案は?
ありがとう!