You are not logged in.

#1 2017-03-24 20:20:33

dreamersbrow
Member
From: Iowa
Registered: 2011-03-27
Posts: 24

Can't open jpeg2000 files

I'm at a little bit of a loss where to start with this one.  I used to be able to open jp2 (jpeg2000) files with programs like okular and darktable.  However, I am now unable to do so.  I have openjpeg installed.  Any ideas what is going on?

Thanks

Offline

#2 2017-03-27 13:01:31

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,981

Re: Can't open jpeg2000 files

Please start one of those programs from an x-terminal and try to open a *jp2 file.

Post the output you get in the xterm.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2017-03-27 13:50:23

dreamersbrow
Member
From: Iowa
Registered: 2011-03-27
Posts: 24

Re: Can't open jpeg2000 files

Okular says:

"/usr/lib/qt/plugins/okular/generators/okularGenerator_kimgio.so"
org.kde.okular.core: Output DPI: QSizeF(86.6987, 86.6987)

The errors on the screen are

Unable to load document: Unsupported image format

and

Could not open file:///test.jp2

Tested this file with Okular in an Ubuntu 16.10 vm and it works. Also, I'm pretty sure I could use Okular on Arch last fall to do this. 

Darktable says:

[exiv2] couldn't find thumbnail for /home/Archives/test.jp2
[rawspeed] (test.jp2) No decoder found. Sorry.
maximum number of samples exceeded (100797360 > 67108864)
error: cannot decode code stream
Magick: Unable to decode image file (/home/Archives/test.jp2).
[GraphicsMagick_open] image `test.jp2' not found
allocation failed???
[exiv2] couldn't find thumbnail for /home/Archives/test.jp2

Again, Darktable in Ubuntu can open it so I don't think it is the file.

I have Jasper, Openjpeg and Openjpeg2 installed.

Thanks

Offline

#4 2017-03-28 12:45:11

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,981

Re: Can't open jpeg2000 files

To make sure the file is recognized correctly, what is the output of
xdg-mime query filetype /path/to/problem/file ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2017-03-28 14:32:59

dreamersbrow
Member
From: Iowa
Registered: 2011-03-27
Posts: 24

Re: Can't open jpeg2000 files

The response to

xdg-mime query filetype test.jp2

was

image/jp2

Offline

#6 2017-03-28 15:24:40

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,981

Re: Can't open jpeg2000 files

That is what it should show.

I found a jp2 file online, and get the same errors as you.

It appears to be a problem with jasper .
darktable seems to use GraphicsMagick which uses jasper ,  not sure if okular also uses jasper .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2017-03-29 13:48:57

dreamersbrow
Member
From: Iowa
Registered: 2011-03-27
Posts: 24

Re: Can't open jpeg2000 files

Hmm. Okay.  Thanks for verifying it wasn't just me.

Offline

#8 2017-03-29 14:41:39

progandy
Member
Registered: 2012-05-17
Posts: 5,268

Re: Can't open jpeg2000 files

What is the output of imginfo? I tried a few sample images and all were displayed using graphicsmagick with jasper.

imginfo -f test.jp2
gm display test.jp2

In case it matters, I have installed freeglut and glu which are optional dependencies of jasper.

Last edited by progandy (2017-03-29 14:59:18)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#9 2017-03-29 14:44:15

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,123

Re: Can't open jpeg2000 files

This was discussed on IRC, it appears to be a change in jasper that makes it not work with images that are too large.

Offline

#10 2017-03-29 15:09:48

dreamersbrow
Member
From: Iowa
Registered: 2011-03-27
Posts: 24

Re: Can't open jpeg2000 files

Hello,

Here is the output:

imginfo -f test.jp2
maximum number of samples exceeded (100797360 > 67108864)
error: cannot decode code stream
cannot load image

Yeah, Scimmia is right. I was in on the discussion about this on IRC last weekend and that was the conclusion there.  It's really unfortunate because some digital archives are using jpeg2000 to make archival copies of the scanned materials.  And at the end of the day, these files are really not that large (8.5" x 11" at 600 PPI is what I'm trying to work with).

Offline

#11 2017-03-29 16:32:49

progandy
Member
Registered: 2012-05-17
Posts: 5,268

Re: Can't open jpeg2000 files

It seems my test images were not large enough.

While jasper is broken, I suggest you add openjpeg2 to the dependency list and build darktable yourself. The buildscript detects the installed openjpeg2 and uses it for j2k instead of jasper via graphicsmagick.

Last edited by progandy (2017-03-29 16:35:08)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#12 2017-03-29 17:23:19

dreamersbrow
Member
From: Iowa
Registered: 2011-03-27
Posts: 24

Re: Can't open jpeg2000 files

@progandy

Thanks for this info.  I will try it out.  Would this method also for for other software like Okular?

Offline

#13 2017-03-29 17:55:04

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,310

Re: Can't open jpeg2000 files

Unlikely, they rely on qt and/or kdelibs and I don't assume all of those are ported to openjpeg (in qt's case the jpeg2000 support seems to be unmaintained even: http://doc.qt.io/qt-5/qtimageformats-index.html )

Last edited by V1del (2017-03-29 17:55:23)

Offline

#14 2017-03-29 18:02:58

progandy
Member
Registered: 2012-05-17
Posts: 5,268

Re: Can't open jpeg2000 files

dreamersbrow wrote:

@progandy

Thanks for this info.  I will try it out.  Would this method also for for other software like Okular?

That will work only in very few cases. The software has to contain code to use openjpeg, and I don't think that okular supports it. Darktable does have it, but the arch maintainer chose to use jasper instead.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#15 2017-03-29 20:21:50

dreamersbrow
Member
From: Iowa
Registered: 2011-03-27
Posts: 24

Re: Can't open jpeg2000 files

V1del wrote:

Unlikely, they rely on qt and/or kdelibs and I don't assume all of those are ported to openjpeg (in qt's case the jpeg2000 support seems to be unmaintained even: http://doc.qt.io/qt-5/qtimageformats-index.html )

Darn, I'm sorry to see this. Thank you though.

Offline

Board footer

Powered by FluxBB