the error im getting when ONLY using IE. when i use firefox it works correctly. im not sure why its doing this.. the server is using php 4.3.11
Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/content/b/u/d/budlight/html/admin/equipment_submit.php on line 46
Warning: imagesx(): supplied argument is not a valid Image resource in /home/content/b/u/d/budlight/html/admin/equipment_submit.php on line 51
Warning: imagesy(): supplied argument is not a valid Image resource in /home/content/b/u/d/budlight/html/admin/equipment_submit.php on line 51
Warning: imagesx(): supplied argument is not a valid Image resource in /home/content/b/u/d/budlight/html/admin/equipment_submit.php on line 62
Warning: imagesy(): supplied argument is not a valid Image resource in /home/content/b/u/d/budlight/html/admin/equipment_submit.php on line 63
Warning: imagecreatetruecolor(): Invalid image dimensions in /home/content/b/u/d/budlight/html/admin/equipment_submit.php on line 66
///////////////////IMAGE 1 main picture///////////////////////////////////////
if ($_FILES['imagea']['name']!=""){
// Get the details of "imagefile"
$filename0 = $_FILES['imagea']['name'];
$temporary_name0 = $_FILES['imagea']['tmp_name'];
$mimetype0 = $_FILES['imagea']['type'];
$filesize0 = $_FILES['imagea']['size'];
// $imagea = "/upload/$id-1.jpg";
//Open the image using the imagecreatefrom..() command based on the MIME type.
switch($mimetype0) {
case "image/jpg":
case "image/jpeg":
$i0 = imagecreatefromjpeg($temporary_name0);
break;
case "image/gif":
$i0 = imagecreatefromgif($temporary_name0);
break;
case "image/png":
$i0 = imagecreatefrompng($temporary_name0);
break;
}
//Delete the uploaded file
// @unlink($temporary_name);
//Save a copy of the original
imagejpeg($i0,"/home/content/b/u/d/budlight/html/upload/$id-main.jpg",80);
//Specify the size of the thumbnail
$dest_x = 300;
$dest_y = 500;
//Is the original bigger than the thumbnail dimensions?
if (imagesx($i0) > $dest_x or imagesy($i0) > $dest_y) {
//Is the width of the original bigger than the height?
if (imagesx($i0) >= imagesy($i0)) {
$thumb_x = $dest_x;
$thumb_y = imagesy($i0)*($dest_x/imagesx($i0));
} else {
$thumb_x = imagesx($i0)*($dest_y/imagesy($i0));
$thumb_y = $dest_y;
}
} else {
//Using the original dimensions
$thumb_x = imagesx($i0);
$thumb_y = imagesy($i0);
}
//Generate a new image at the size of the thumbnail
$thumb0 = imagecreatetruecolor($thumb_x,$thumb_y);
//Copy the original image data to it using resampling
imagecopyresampled($thumb0, $i0 ,0, 0, 0, 0, $thumb_x, $thumb_y, imagesx($i0), imagesy($i0));
//Save the thumbnail
imagejpeg($thumb0, "/home/content/b/u/d/budlight/html/upload/$id-main.jpg", 80);
}
////////////////////////END IMAGE 1 main picture////////////////////////////
line 46: imagejpeg($i0,"/home/content/b/u/d/budlight/html/upload/$id-main.jpg",80);
line 51: if (imagesx($i0) > $dest_x or imagesy($i0) > $dest_y) {
line 62/63: $thumb_x = imagesx($i0);
$thumb_y = imagesy($i0);