[PHP] imagecreatefromjpeg(), getimagesize() and file_get_contents() NOT WORKING!

Status
Not open for further replies.

sicelx10

Member
Messages
126
Reaction score
2
Points
18
Im getting this error when i want to resize an image:
Warning: getimagesize(http://******/manipularimg/imagenes/cielomorado.jpg): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in/home/*******/public_html/manipularimg/recortar.php on line 17

Warning: imagecreatefromjpeg(http://********/manipularimg/imagenes/cielomorado.jpg): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in/home/********/public_html/manipularimg/recortar.php on line 20
I tested in another server and worked well.

Same happens with file_get_contents(), sometimes it works and sometimes doesnt work these three functions. I reported this issue 2 months ago, and it was fixed, but now im having this problem again :'(
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Are these images from outside sites?

If you are trying to get the images from your own account -- use internal paths, not web URLs.

Also, a 400 error suggests that the function makes the connection, but something is wrong with the request. Can you retrieve the image via the URL in your browser?
 
Last edited:

sicelx10

Member
Messages
126
Reaction score
2
Points
18
When i use internal paths the page or image doesnt show properly :(, but when i use the external path of my own page sometimes works and sometimes doesnt work, that means that the problem is not with me.
 

sicelx10

Member
Messages
126
Reaction score
2
Points
18
I resolved the problem in file_get_contents(), i replaced with include and used an internal path.

BUT THE PROBLEM with imagecreatefromjpeg() and getimagesize() still persist :(
 
Status
Not open for further replies.
Top