| Summary: | Crash when confirming a face suggestion when Exiv2 reads 0x0 image size | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Harm <kdebugs> |
| Component: | Faces-Engine | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | caulier.gilles, metzpinguin |
| Priority: | NOR | ||
| Version First Reported In: | 8.8.0 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 9.0.0 | |
| Sentry Crash Report: | |||
You are right, digikam do not must crash but the original problem come from exiv2 which return a null size. This problem must be reported to Exiv2 project too: https://github.com/Exiv2/exiv2/issues I converted a few JPG images here using the "cjxl" command. For all of them, Exiv2 has the image size and the Exif metadata of the original JPG image. What I find very concerning, however, is that ExifTool has the image size, but no additional metadata, no Exif, or MakerNotes (even on the command line). This would have to be clarified with ExifTool first. Can you provide an image with a 0x0 image size? Maik Git commit cb20b27f26e66067f13b7bc3d81ad1e9533d7de9 by Maik Qualmann. Committed on 27/10/2025 at 07:38. Pushed by mqualmann into branch 'master'. check double values on infinity to prevent crash FIXED-IN: 8.9.0 M +10 -0 core/libs/database/tags/tagregion.cpp https://invent.kde.org/graphics/digikam/-/commit/cb20b27f26e66067f13b7bc3d81ad1e9533d7de9 For ExifTool to read and write compressed JXL metadata, the perl-compress-brotli module is required. Since the image size in the database doesn't necessarily come from the metadata (after all, there are also images with no metadata at all), I suspect that the JXL images were scanned when digiKam couldn't read the format via the QImage reader. Please reread the metadata of the JXL images. Maik Thanks for the quick response and fix! Maybe I can recompile my digiKam to test. I'll try that later. Exiftool outputs 259 lines on the jxl file, hence I only copied the width/height to show that, sorry for the confusion. I also notice that other images I convert to jxl work fine with exiv2. The problematic image is a JPG image a friend of mine edited in Adobe Lightroom 8.5.1 (Macintosh) and exported to JPG. I have an example file, with these steps: 1. Export in Lightroom -> test.jpg 2. `exiftool -all= test.jpg` -> https://harmberntsen.nl/dump/511184/test.jpg 3. `cjxl --num_threads=0 --effort=10 --lossless_jpeg=1 test.jpg test.jxl` -> https://harmberntsen.nl/dump/511184/test.jxl In this test.jxl file, exiv2 shows a 0 x 0 image size. I've stripped the exif data because the name of my friend is in there and I prefer not to share that information when not necessary. For reference, I'm using these versions: $ cjxl --version cjxl v0.11.1 794a5dcf [AVX3_DL,AVX3,AVX2,SSE4,SSE2] Copyright (c) the JPEG XL Project $ exiv2 --version exiv2 0.28.7 I'll try re-reading the metadata! I already did thumbnail regeneration but that did not help. For image size, don't look at the Exif metadata; instead, check the Properties tab to see what size digiKam captured. Your test.jxl file is 5472x3648. Okay, the crash has been fixed for the future; I'm closing this bug. Maik I've recompiled digiKam and it doesn't crash any more. Thanks Maik for the quick fix! |
SUMMARY When accepting a face suggestion, digiKam crashes. This is on a jxl file that has been converted from a jpg file using `cjxl --num_threads=0 --effort=10 --lossless_jpeg=1`. Exiv2 reads a 0x0 image size that digiKam cannot handle. STEPS TO REPRODUCE 1. Open the problematic image in digiKam (that has already been scanned for faces). 2. Click confirm at a face suggestion OBSERVED RESULT A crash: ASSERT failure in constexpr QtPrivate::QCheckedIntegers::QCheckedInt<int> QtPrivate::QCheckedIntegers::operator+(QCheckedInt<int>, QCheckedInt<int>): "Overflow in operator+", file /usr/include/qt6/QtCore/qcheckedint_impl.h, line 69 EXPECTED RESULT Face is accepted SOFTWARE/OS VERSIONS Arch Linux (Wayland) KDE Frameworks Version: 6.19.0 Qt Version: 6.10.0, built against 6.10.0 ADDITIONAL INFORMATION The backtrace is: #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x00007ffff3a98a13 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89 #2 0x00007ffff3a3e410 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x00007ffff3a2557a in __GI_abort () at abort.c:77 #4 0x00007ffff429348c in qAbort () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qassert.cpp:46 #5 qt_maybe_message_fatal<QString&> (msgType=QtFatalMsg, context=..., message=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qlogging.cpp:2165 #6 qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, context=..., msg=msg@entry=0x7ffff467a2b8 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=ap@entry=0x7ffd867f9d98) at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qlogging.cpp:412 #7 0x00007ffff4294250 in QMessageLogger::fatal (this=<optimized out>, msg=0x7ffff467a2b8 "ASSERT failure in %s: \"%s\", file %s, line %d") at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qlogging.cpp:901 #8 0x00007ffff429197a in qt_assert_x (where=<optimized out>, what=<optimized out>, file=file@entry=0x7ffff6d172b0 "/usr/include/qt6/QtCore/qcheckedint_impl.h", line=line@entry=69) at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qassert.cpp:122 #9 0x00007ffff60c6954 in QtPrivate::QCheckedIntegers::AssertReportPolicy::check(bool, char const*, char const*) [clone .part.0] [clone .lto_priv.0] [clone .lto_priv.0] (where=<optimized out>, description=<optimized out>, ok=<optimized out>) at /usr/include/qt6/QtCore/qcheckedint_impl.h:69 #10 0x00007ffff60f50cc in QtPrivate::QCheckedIntegers::AssertReportPolicy::check (ok=<optimized out>, where=<optimized out>, description=<optimized out>) at /usr/include/qt6/QtCore/qrect.h:897 #11 QtPrivate::QCheckedIntegers::operator+ (lhs=..., rhs=...) at /usr/include/qt6/QtCore/qcheckedint_impl.h:152 #12 QRect::QRect (this=<optimized out>, aleft=..., atop=..., awidth=..., aheight=...) at /usr/include/qt6/QtCore/qrect.h:143 #13 QRect::QRect (this=<optimized out>, aleft=<optimized out>, atop=<optimized out>, awidth=<optimized out>, aheight=<optimized out>) at /usr/include/qt6/QtCore/qrect.h:167 #14 QRectF::toRect (this=0x7ffd867fa060) at /usr/include/qt6/QtCore/qrect.h:896 #15 0x00007ffff687a7df in Digikam::TagRegion::mapFromOriginalSize (fullImageSize=..., reducedImageSize=..., fullSizeDetail=...) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/database/tags/tagregion.cpp:250 #16 0x00007ffff64d3d57 in Digikam::ThumbnailCreator::loadImageDetail (this=this@entry=0x7ffdfc001810, info=..., metadata=..., detailRect=..., profile=profile@entry=0x7ffd867fa200) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/threadimageio/thumb/thumbnailcreator_engine.cpp:307 #17 0x00007ffff64d895e in Digikam::ThumbnailCreator::createThumbnail (this=this@entry=0x7ffdfc001810, info=..., detailRect=...) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/threadimageio/thumb/thumbnailcreator_engine.cpp:52 #18 0x00007ffff64d9a0f in Digikam::ThumbnailCreator::load (this=0x7ffdfc001810, identifier=..., rect=..., pregenerate=pregenerate@entry=false, onlyStorage=false) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/threadimageio/thumb/thumbnailcreator.cpp:276 #19 0x00007ffff64d9ca0 in Digikam::ThumbnailCreator::loadDetail (this=<optimized out>, identifier=..., rect=..., onlyStorage=<optimized out>) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/threadimageio/thumb/thumbnailcreator.cpp:175 #20 0x00007ffff64ec639 in Digikam::ThumbnailLoadingTask::execute (this=0x7ffdfc003e10) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/threadimageio/thumb/thumbnailtask.cpp:174 #21 0x00007ffff64e5d16 in Digikam::LoadSaveThread::run (this=0x7ffdfc001510) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/threadimageio/fileio/loadsavethread.cpp:118 #22 0x00007ffff652b18b in Digikam::DynamicThread::Private::run (this=0x7ffdfc001420) at /usr/src/debug/digikam/digikam-8.8.0/core/libs/threads/dynamicthread.cpp:176 #23 0x00007ffff4490855 in QThreadPoolThread::run (this=0x555575829ba0) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthreadpool.cpp:72 #24 0x00007ffff4530ca9 in operator() (__closure=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread_unix.cpp:437 #25 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread_unix.cpp:367 #26 QThreadPrivate::start (arg=0x555575829ba0) at /usr/src/debug/qt6-base/qtbase/src/corelib/thread/qthread_unix.cpp:397 #27 0x00007ffff3a969cb in start_thread (arg=<optimized out>) at pthread_create.c:448 #28 0x00007ffff3b1aa0c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78 So the problem is that orgSize in ThumbnailCreator::loadImageDetail has zero values. (gdb) p orgSize $14 = {wd = {<QtPrivate::QCheckedIntegers::CheckIntTypeHelper<int>> = {<No data fields>}, m_i = 0}, ht = {<QtPrivate::QCheckedIntegers::CheckIntTypeHelper<int>> = {<No data fields>}, m_i = 0}} (gdb) p previews.originalSize() $18 = {wd = {<QtPrivate::QCheckedIntegers::CheckIntTypeHelper<int>> = {<No data fields>}, m_i = 0}, ht = {<QtPrivate::QCheckedIntegers::CheckIntTypeHelper<int>> = {<No data fields>}, m_i = 0}} This one is obtained through previews.originalSize() but never checked whether it has non-zero values. Later on, mapFromOriginalSize is assuming non-zero values. Looking at MetaEnginePreviews, it is using Exiv2. When I run Exiv2 0.28.7 on the corresponding image, it says: exiv2 image.jxl File name : image.jxl File size : 11060735 Bytes MIME type : image/jxl Image size : 0 x 0 Thumbnail : image/jpeg, 20347 Bytes Camera make : Canon Camera model : Canon EOS R6 Image timestamp : 2025:10:16 13:21:10 File number : Exposure time : 1/400 s Aperture : F2.8 Exposure bias : 0 EV Flash : No flash Flash bias : Focal length : 50.0 mm Subject distance: ISO speed : 200 Exposure mode : Manual Metering mode : Multi-segment Macro mode : Image quality : White balance : Auto Copyright : Exif comment : This shows an image size of 0. This is a jxl file that is created losslessly from a jpg. When I convert it back, it is fine: $ djxl image.jxl image.jpg $ exiv2 image.jpg File name : image.jpg File size : 13232302 Bytes MIME type : image/jpeg Image size : 5472 x 3648 Thumbnail : image/jpeg, 20347 Bytes Camera make : Canon Camera model : Canon EOS R6 Image timestamp : 2025:10:16 13:21:10 File number : Exposure time : 1/400 s Aperture : F2.8 Exposure bias : 0 EV Flash : No flash Flash bias : Focal length : 50.0 mm Subject distance: ISO speed : 200 Exposure mode : Manual Metering mode : Multi-segment Macro mode : Image quality : White balance : Auto Copyright : Exif comment : It now sees the size. So even though the underlying issue is in ExiV2, digiKam shouldn't crash, right? For reference, exiftool does show the correct size on the jxl image: Image Width : 5472 Image Height : 3648