Issues reading JPEG-XR (jxr) images

371 views
Skip to first unread message

Lee H.

unread,
Sep 7, 2015, 8:29:43 AM9/7/15
to imageio
I installed the freetype lib on Ubuntu with

    sudo apt-get install libfreeimage-dev

but I am still having issues getting imageio to read .jxr images in my Python script. 

Doing

    im = imageio.imread('my.jxr')

returns

   ValueError: Could not load bitmap "/tmp/my.jxr": Unsupported format


(The only way I've managed to read these files so far in Ubuntu is with libjxr-tools and then using ImageMagick's `convert in.jxr out.tif` for example)

I thought imageio supports JPEG-XR images though?

Almar Klein

unread,
Sep 7, 2015, 9:18:30 AM9/7/15
to ima...@googlegroups.com
It should: http://imageio.readthedocs.org/en/latest/format_jpeg-xr.html

Try doing

im = imageio.imread('my.jxr', format='JPEG-XR')

to force the xr format. Still strange, I would expect the format to have
been picked up automatically. Maybe this is a bug in freeimage.

- Almar
> --
> You received this message because you are subscribed to the Google
> Groups "imageio" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to imageio+u...@googlegroups.com
> <mailto:imageio+u...@googlegroups.com>.
> To post to this group, send email to ima...@googlegroups.com
> <mailto:ima...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/imageio.
> For more options, visit https://groups.google.com/d/optout.

Lee H.

unread,
Sep 7, 2015, 10:05:03 AM9/7/15
to imageio
I'm afraid that didn't help.

In the meantime, I installed the master branch of imageio, and installed the latest freeimage from source (3.17). The error changed a little

    ValueError: Could not load bitmap "/tmp/my.jxr": Unsupported format

I attached one of the images I'm playing with...

tmphlpS5k.jxr

Lee H.

unread,
Sep 7, 2015, 10:12:01 AM9/7/15
to imageio
Actually the error the same   (not sure why I read otherwise, but there you go!)

Lee H.

unread,
Sep 7, 2015, 10:22:08 AM9/7/15
to imageio
Also, I did some temporary debug prints in the src and I can see that 
`self.format.fif` in the Reader defined in freeimage.py is 36, which matches
JPEG-XR: 

('JPEG-XR', 36, 'JPEG XR image format', 'jxr,wdp,hdp')

so format is being picked up correctly it seems, but it has trouble
at `fi.create_bitmap`

Almar Klein

unread,
Sep 7, 2015, 10:44:22 AM9/7/15
to ima...@googlegroups.com
Could it be a variant of the format that is not supported by freeimage?

Lee H.

unread,
Sep 7, 2015, 10:08:00 PM9/7/15
to imageio
Possibly, would you know how to check? All I know so far is the image loads without issue on Windows, and on linux ImageMagick's `convert` can covert it to a tif or JxrDecApp does it (I think ImageMagick's convert might be just delegating to JxrDecApp actually).  

Almar Klein

unread,
Sep 8, 2015, 6:11:48 AM9/8/15
to ima...@googlegroups.com
> the image loads without issue on Windows

With imageio?
Reply all
Reply to author
Forward
0 new messages