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.


Error in function loadImage: That file cannot be loaded with

 
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
jeyaloui
Newbie


Joined: 02 Oct 2004
Posts: 3

PostPosted: Sat Oct 02, 2004 7:40 am    Post subject: Error in function loadImage: That file cannot be loaded with Reply with quote

I am getting this error

Error in function loadImage: That file cannot be loaded with the function 'imagecreatefromjpeg'.

I just copied ur code and did slight changes

Nothing is working for me. i found this code very usefull, can anyone help to identify this problem
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Sat Oct 02, 2004 9:44 am    Post subject: Reply with quote

Hi, and welcome to the board!

Three things spring to mind. First is that you don't actually have the jpeg libraries installed on your server. You can check this out in the phpinfo() output (in the GD section). Simply put:

PHP:
<?php phpinfo(); ?>


into a file and load it up on your web server. Look at the GD section and you should hopefully see something like:

Quote:
JPG Support enabled


If you don't, then you need to get them installed.

Secondly, is it really a jpg file you're trying to load, or is it, for example, a PNG file but it's being forced to try to load as a jpg?

Thirdly, and the most likely, is that you don't have permissions to load the file, or you're looking for it in the wrong place. Make sure that the location you're passing to the loadImage method is correct, and then make sure that your web server has permissions enough to be able to read that file.

Hopefully that'll help you out.

Regards,

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jeyaloui
Newbie


Joined: 02 Oct 2004
Posts: 3

PostPosted: Sun Oct 03, 2004 1:29 am    Post subject: Thanx Reply with quote

Hi andy

thanx for ur help it is working for me and i have another simple problem like

Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\photo\test\class.cropcanvas.php:480) in c:\apache\htdocs\photo\test\photo.php on line 9

can u explain me about this

thanx in advance
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Sun Oct 03, 2004 8:14 am    Post subject: Reply with quote

Hi,

A number of people has this same problem, so you'll find threads like this. However...

You are trying to output two different headers. Presumably you are using the test script which tried to show the image once it's been cropped. Well, to do that the script sends a 'header' request saying that it's trying to output some image information. But the problem is that somewhere along the line you have already sent a header request - even if you didnt mean to. This usually comes about by having white-space in the script, somewhere before your image header request. White space (a space, tab, newline, etc.) is regarded as text/html content.

Two ways to counter this:

remove the white space from the class file - anything before the opening '<?php' and after the closing '?>', be it newlines or spaces.

use output buffering; ob_start and so on. You can look up information about these on the php.net website, if you're unfamiliar with how they work.

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