| Summary: | Cut and paste crash, jas_init_library: Assertion `!jas_global.initialized' failed | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Dave Gilbert <gilbertd+kde> |
| Component: | Plugin-DImg-JP2K | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | metzpinguin, nucleo |
| Priority: | NOR | ||
| Version First Reported In: | 9.0.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/digikam/-/commit/9dd5e992b71b6a855fc419114344d4bd181bc08f | Version Fixed/Implemented In: | 9.1.0 |
| Sentry Crash Report: | |||
|
Description
Dave Gilbert
2026-03-15 00:24:16 UTC
The second Jasper initialization comes from the KImageFormat plugins, specifically from our QImage Loader. For some reason, the image is being rejected by our Jpeg2000 Loader, resulting in a fallback to the QImage Loader and thus triggering the second Jasper initialization. We need to block Jpeg2000 files for our QImage Loader. I see no other option. Maik I now see that it's a save operation; the QImage Loader is saving a file. What file format is being saved when it crashes? Maik Okay, it's a paste operation and it uses QImage::save()... Maik We set the image selection as a QImage using QMimeData::setImageData() and pass it to the QClipboard. Internally in Qt, it's then stored as a Jpeg2000 image in QInternalMimeData::renderDataHelper(). Normally, Qt would process it as a PNG. So I suspect Fedora patched something to improve interaction with GNOME programs. To avoid encoding the QMimeData myself, I'll take a different approach... Maik (In reply to Maik Qualmann from comment #4) > We set the image selection as a QImage using QMimeData::setImageData() and > pass it to the QClipboard. Internally in Qt, it's then stored as a Jpeg2000 > image in QInternalMimeData::renderDataHelper(). Normally, Qt would process > it as a PNG. So I suspect Fedora patched something to improve interaction > with GNOME programs. > > To avoid encoding the QMimeData myself, I'll take a different approach... > > Maik The jasper library init all seems rather delicate; neither or the routes that use it sound unreasonable, and who knows if another plugin would call a library that would want it somewhere. Git commit 9dd5e992b71b6a855fc419114344d4bd181bc08f by Maik Qualmann. Committed on 15/03/2026 at 19:23. Pushed by mqualmann into branch 'master'. use the QImage Loader if JPEG2000 is available. Since jas_init_library() and jas_cleanup_library() can only be called once in the main thread, it is almost impossible to handle them if another Jasper Loader is present in a library. FIXED-IN: 9.1.0 M +1 -1 NEWS M +13 -2 core/dplugins/dimg/jpeg2000/dimgjpeg2000plugin.cpp https://invent.kde.org/graphics/digikam/-/commit/9dd5e992b71b6a855fc419114344d4bd181bc08f (In reply to Maik Qualmann from comment #6) > Git commit 9dd5e992b71b6a855fc419114344d4bd181bc08f by Maik Qualmann. > Committed on 15/03/2026 at 19:23. > Pushed by mqualmann into branch 'master'. > > use the QImage Loader if JPEG2000 is available. > Since jas_init_library() and jas_cleanup_library() can only be > called once in the main thread, it is almost impossible to > handle them if another Jasper Loader is present in a library. > FIXED-IN: 9.1.0 > > M +1 -1 NEWS > M +13 -2 core/dplugins/dimg/jpeg2000/dimgjpeg2000plugin.cpp > > https://invent.kde.org/graphics/digikam/-/commit/ > 9dd5e992b71b6a855fc419114344d4bd181bc08f Thanks - that was quick! Maik built testing packages on Fedora with that fix in, andit seems to fix it for me. Thanks again, Dave |