ライブラリ WideImage を使用して、アップロードされた画像のサイズを 2 つの別々のサイズに変更し、その画像を 2 つの別々のディレクトリに保存しています。問題は、小さい画像が常に保存されるとは限らないことです。これが私の試みです:
if(move_uploaded_file($_FILES['image']['tmp_name'], "../images/temp/$id.jpg")){
include '../../WideImage/WideImage.php';
$successfull = 0;
if($image = WideImage::load("../images/temp/$id.jpg")){
if($large=$image->resize(500, 375)){
$large->saveToFile("../images/large/product_$id.jpg");
$successfull = 1;
}
}
if($successfull==1){
$successfull = 0;
if($image_2 = WideImage::load("../images/temp/$id.jpg")){
if($small=$image_2->resize(300, 225)){
$small->saveToFile("../images/small/product_$id.jpg");
$successfull = 1;
}
}
if($successfull!=1){
$showError='style="background:#c60000;"';
$myError="An Error Occured Please Try Again";
}
else {
unlink("../images/temp/$id.jpg");
header("location: products.php");
exit;
}
}
これは常に私にエラーを与えています。私の推測では、画像の保存に時間がかかっています。私の質問は、すべてのステップが正常に完了したことを確認するにはどうすればよいですか?