getimagesize() not working for jpx images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dimxasnewfrozen
Forum Commoner
Posts: 84
Joined: Fri Oct 30, 2009 1:21 pm

getimagesize() not working for jpx images

Post by dimxasnewfrozen »

I'm trying to validate JPX images using the getimagesize() method. No matter the file, the result is always null. It's working fine for jp2 images, tiff images, and other formats. The PHP documentation says it should support JPX images but I can't seem to get it working.

I'm simply just doing this:

Code: Select all

$info = getimagesize("bx_1323.jpx");
var_dump($info);
I've tried with about 5 different jpx images. I've inspected the headers of the files and they all seem valid.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: getimagesize() not working for jpx images

Post by Christopher »

What version of PHP are you using? Perhaps it is an older version that does not support .jpx yet? Have you checked that there is no error with your image?

You could also try finfo_file().
(#10850)
dimxasnewfrozen
Forum Commoner
Posts: 84
Joined: Fri Oct 30, 2009 1:21 pm

Re: getimagesize() not working for jpx images

Post by dimxasnewfrozen »

I've tried on both 5.4 and 5.5.12 and get the same result (null). I can open the jpx images fine with different image viewers.

I was originally looking into finfo_file() but I keep getting "application/octet-stream" for everything.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: getimagesize() not working for jpx images

Post by Christopher »

Is there something wrong with the file or permissions? getimagesize() should return an array or false, not null. Do you have error reporting on enough so that you know you don't have some error happening?
(#10850)
dimxasnewfrozen
Forum Commoner
Posts: 84
Joined: Fri Oct 30, 2009 1:21 pm

Re: getimagesize() not working for jpx images

Post by dimxasnewfrozen »

No errors reported. I haven't touched the permissions but I'd assume they're okay since other files work fine.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: getimagesize() not working for jpx images

Post by requinix »

Can you post the image?
Post Reply