Page 1 of 1

JPEG filetype/imagecreatefromjpeg() unrecognized with upload

Posted: Thu Aug 24, 2006 8:42 pm
by IceMetalPunk
First, to get it out of the way: I'm using dajoob.com as my server, since Ripway doesn't allow e-mail or uploads via PHP.

I'm working on a Twisted Designs GFX - The Site kind of thing. I have so far gotten it to work where people can upload their own images into a global TDG: The Site gallery, along with artist, title, and description of the image.

It all seemed to work, until I tried a JPEG. The MIME filetype that is being sent to the PHP script for JPEG images is a blank string, instead of the expected "image/jpeg" or even "image/jpg". As well, the imagecreatefromjpeg() function is unknown to PHP on my site, yet all the other imagecreatefrom* functions work. Anyone know why this is happening?

As well, I haven't found a way to create an image resource from a BMP (WBMP is apparently different). Is there one?

-IMP ;) :)

Posted: Thu Aug 24, 2006 8:46 pm
by feyd
getimagesize() is generally able to determine the common file types. As for BMP, there is nothing native. You can write one (it's a very simple file format, just look on MSDN) or I'd bet someone or yourself could dig one up.

Posted: Fri Aug 25, 2006 2:08 pm
by pickle
Just curious why you need to make an image resource for BMP files. Are you going to be modifying the file beyond simple resizing & format conversion? If not, you can see if you can install ImageMagick - it has support for BMP files.

Posted: Fri Aug 25, 2006 3:01 pm
by IceMetalPunk
I'll look into getimagesize()

As for BMP, are there functions already online that can do that?

And lastly, I have no control over any PHP extensions, because I have no control over anything on the server but my own files (dajoob.com has all the control :P )

-IMP ;) :)

*EDIT* Well, I found a BMP functions pack online, thanks for telling me that. As for the JPEG, even using getimagesize() to get the filetype, everything is okay except that JPEG's aren't recognized (their filetype is a blank string). Plus, even once I get past that problem, imagecreatefromjpeg() isn't a recognized function either... :(