When I run the following code:
<?php
// example.php
#require_once $_SERVER['DOCUMENT_ROOT'].'/common/configs/config_templates.inc.php';
require "thumbimage.class.php";
/* $objThumbImage = new ThumbImage("/web/uploads/orig.jpg");
$objThumbImage->createThumb("/web/uploads/thumb.jpg", 125); */
$objThumbImage = new ThumbImage("/web/uploads/orig.jpeg"); // IMPORTANT - THIS LINE WORKS FINE
$objThumbImage->createThumb("/web/uploads/thumb.jpeg", 125);
?>
I receive the following error
Warning: imagecreatefromjpeg(/web/uploads/orig.jpeg): failed to open stream: No such file or directory in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 12
Warning: imagesx() expects parameter 1 to be resource, bool given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 13
Warning: imagesy() expects parameter 1 to be resource, bool given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 14
Warning: Division by zero in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 15
Warning: imagecreatetruecolor() expects parameter 2 to be int, float given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 16
Warning: imagecopyresampled() expects parameter 1 to be resource, null given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 17
Warning: imagejpeg() expects parameter 1 to be resource, null given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 18
Warning: imagedestroy() expects parameter 1 to be resource, bool given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 19
Warning: imagedestroy() expects parameter 1 to be resource, null given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 20
The files - like orig.jpeg - in question appear to be there, so, I'm confused by the error.
<?php
// example.php
#require_once $_SERVER['DOCUMENT_ROOT'].'/common/configs/config_templates.inc.php';
require "thumbimage.class.php";
/* $objThumbImage = new ThumbImage("/web/uploads/orig.jpg");
$objThumbImage->createThumb("/web/uploads/thumb.jpg", 125); */
$objThumbImage = new ThumbImage("/web/uploads/orig.jpeg"); // IMPORTANT - THIS LINE WORKS FINE
$objThumbImage->createThumb("/web/uploads/thumb.jpeg", 125);
?>
I receive the following error
Warning: imagecreatefromjpeg(/web/uploads/orig.jpeg): failed to open stream: No such file or directory in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 12
Warning: imagesx() expects parameter 1 to be resource, bool given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 13
Warning: imagesy() expects parameter 1 to be resource, bool given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 14
Warning: Division by zero in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 15
Warning: imagecreatetruecolor() expects parameter 2 to be int, float given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 16
Warning: imagecopyresampled() expects parameter 1 to be resource, null given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 17
Warning: imagejpeg() expects parameter 1 to be resource, null given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 18
Warning: imagedestroy() expects parameter 1 to be resource, bool given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 19
Warning: imagedestroy() expects parameter 1 to be resource, null given in C:\xamppNew\htdocs\photo\thumbimage.class.php on line 20
The files - like orig.jpeg - in question appear to be there, so, I'm confused by the error.