andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


Loading problems

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
manicleek
Newbie


Joined: 07 Feb 2006
Posts: 3

PostPosted: Mon Dec 04, 2006 10:50 am    Post subject: Loading problems Reply with quote

I keep getting the error

Code:
Error in function loadImage: The image could not be loaded.


I have no idea why images can't be loaded, my file permissions are set to 777 and the image is definitely on the server.


The code on my site is

Code:
$cropFile = 'media/'.$this->fileName;
$this->cropCanvas->loadImage($cropFile);


I have done an output on the file path and everything was fine.

What other reasons are there for a file to not properly load?


*Edit

I have just tried echoing the line "$func($filename);" and I get:

Code:
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in C:\sites\classes\upload\cropcanvas.php on line 118

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'media/101_9732.jpg' is not a valid JPEG file: in C:\sites\classes\upload\cropcanvas.php on line 118


I'm using gd2 and I have also used this before for other sites on the same server and everything was fine
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Mon Dec 04, 2006 11:20 am    Post subject: Reply with quote

The error that's display is:

"not a valid JPEG file"

Are you sure that 101_9732.jpg is valid? Can you pull it up in your browser or an image manipulation program? If it is valid then perhaps it's just a path problem. Try assigning $cropFile like this and see if it helps:

$cropFile = dirname(__FILE__) . '/media/' . $this->fileName;

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group