Summary: | After saving a .jp2 file the file could not be open. | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Paul <suskop> |
Component: | Plugin-DImg-JP2K | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | grave | CC: | caulier.gilles, metzpinguin |
Priority: | NOR | ||
Version: | 7.4.0 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | https://invent.kde.org/graphics/digikam/commit/440951f977929d90b06141d23d03e84a5bd83d00 | Version Fixed In: | 7.5.0 |
Sentry Crash Report: |
Description
Paul
2021-12-19 20:35:05 UTC
When i google this error seems to be a problem in libjasper: maximum number of samples exceeded (72480768 > 67108864) error: cannot decode code stream Gimp can open the JPEG2000 files created by digiKam. Maik gimp use OpenJPEG, not Jasper : https://github.com/GNOME/gimp/blob/master/plug-ins/common/file-jp2-load.c#L88 MXE build Jasper version 2.0.33 : https://github.com/mxe/mxe/blob/master/src/jasper.mk#L7 So we use the last stable version in digiKam for Windows : https://github.com/jasper-software/jasper/releases GDal project use openjpeg to wrap around this issue : https://github.com/OSGeo/gdal/issues/2198 ... The whole thing seems to be dependent on the image size, images with 2000x3000px work, with 4000x6000px the problem occurs. Maik A little bit old but interesting : https://bbs.archlinux.org/viewtopic.php?pid=1700769#p1700769 I recommend to UPSTREAM this bug to Jasper project in github. Gilles Caulier Seriously, Jasper codec do not support image size of 24Mpx ? (:-)))... This problem is also reproducible under Linux. too weird ! Paul, This problem from JPEG2000 codec must be reported to Jasper library project as UPSTREAM bug here : https://github.com/jasper-software/jasper/issues Thanks in advance Gilles Caulier UPSTREAM bug : https://github.com/jasper-software/jasper/issues/315 Maik, We receive a response : https://github.com/jasper-software/jasper/issues/315#issuecomment-1004465646 To resume : it miss a Jasper setting call in DImg::JP2Loader to configure a data size limit before to decode image. Gilles Hi Gilles,
The function should be "jas_conf_set_dec_default_max_samples (0);" being. The
zero ignores the size, could be dangerous. It just doesn't compile for me
because my Libjasper doesn't yet contain the function.
Maik
Am Dienstag, 4. Januar 2022, 07:44:41 CET schrieben Sie:
> https://bugs.kde.org/show_bug.cgi?id=447240
>
> --- Comment #10 from caulier.gilles@gmail.com ---
> Maik,
>
> We receive a response :
> https://github.com/jasper-software/jasper/issues/315#issuecomment-1004465646
>
> To resume : it miss a Jasper setting call in DImg::JP2Loader to configure a
> data size limit before to decode image.
>
> Gilles
I have Libjasper 2.0.33 here and it is still a fixed compiled size there.
#if !defined(JAS_DEC_DEFAULT_MAX_SAMPLES)
#define JAS_DEC_DEFAULT_MAX_SAMPLES (64 * ((size_t) 1048576))
#endif
Maik
Am Dienstag, 4. Januar 2022, 08:43:45 CET schrieben Sie:
> Hi Gilles,
>
> The function should be "jas_conf_set_dec_default_max_samples (0);" being.
> The zero ignores the size, could be dangerous. It just doesn't compile for
> me because my Libjasper doesn't yet contain the function.
>
> Maik
>
> Am Dienstag, 4. Januar 2022, 07:44:41 CET schrieben Sie:
> > https://bugs.kde.org/show_bug.cgi?id=447240
> >
> > --- Comment #10 from caulier.gilles@gmail.com ---
> > Maik,
> >
> > We receive a response :
> > https://github.com/jasper-software/jasper/issues/315#issuecomment-10044656
> > 46
> >
> > To resume : it miss a Jasper setting call in DImg::JP2Loader to configure
> > a
> > data size limit before to decode image.
> >
> > Gilles
Git commit 440951f977929d90b06141d23d03e84a5bd83d00 by Gilles Caulier. Committed on 08/01/2022 at 04:20. Pushed by cgilles into branch 'master'. Pass JP2 decoder option string with max samples value to prevent broken load image in preview and image editor. See UPSTREAM bug details : https://github.com/jasper-software/jasper/issues/315#issuecomment-1007872809 FIXED-IN: 7.5.0 M +32 -21 core/dplugins/dimg/jpeg2000/dimgjpeg2000loader_load.cpp M +10 -7 core/dplugins/dimg/jpeg2000/dimgjpeg2000loader_save.cpp https://invent.kde.org/graphics/digikam/commit/440951f977929d90b06141d23d03e84a5bd83d00 |