View previous topic :: View next topic |
Author |
Message |
jeyaloui Newbie
Joined: 02 Oct 2004 Posts: 3
|
Posted: Sat Oct 02, 2004 7:40 am Post subject: Error in function loadImage: That file cannot be loaded with |
|
|
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 |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Sat Oct 02, 2004 9:44 am Post subject: |
|
|
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:
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 |
|
 |
jeyaloui Newbie
Joined: 02 Oct 2004 Posts: 3
|
Posted: Sun Oct 03, 2004 1:29 am Post subject: Thanx |
|
|
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 |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Sun Oct 03, 2004 8:14 am Post subject: |
|
|
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 |
|
 |
|
|
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
|