Bug 360714

Summary: JPGEG2000 thumbnails shows as dimension 0x0 pixel - Use ExifTool to get right image properties
Product: [Applications] digikam Reporter: Ulrich Eckhardt <kde>
Component: Metadata-ExifToolAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 7.0.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 8.1.0
Sentry Crash Report:
Attachments: Generated jp2000
Full log of AppImage 5.5.0 from a console
Screenshot of DigiKam showing size 0x0
Screenshot digiKam 8.0.0 showing the size 0x0

Description Ulrich Eckhardt 2016-03-18 18:29:58 UTC
JPEG 2000 files are always displayed 0x0 (0.00 Mpx) as image dimension in the ambum view instead of their correct width and height.

Reproducible: Always

Steps to Reproduce:
1. Enable "Show image dimensions" for the album view
2. View a jpeg 2000 file in the preview area.


Actual Results:  
0x0 (0.00 Mpx) is displayed as dimension.

Expected Results:  
Display the correct image dimension.
Comment 1 Maik Qualmann 2016-03-18 22:52:08 UTC
The cause is the Bug 195583 and Bug 215458. While scanning images should not load the entire JPEG2000 image into memory. As an alternative, the metadata is used. Probably have your images no metadata?

Maik
Comment 2 Ulrich Eckhardt 2016-03-19 12:17:58 UTC
At least exif tool displays the folllowing  metadata, but this metadata is not displayed in the metadata tab:

uli:~/Pictures # exiftool a_100.jp2 
ExifTool Version Number         : 9.76
File Name                       : a_100.jp2
Directory                       : .
File Size                       : 2.2 MB
File Modification Date/Time     : 2016:03:18 19:27:12+01:00
File Access Date/Time           : 2016:03:18 19:27:12+01:00
File Inode Change Date/Time     : 2016:03:18 19:27:12+01:00
File Permissions                : rw-r--r--
File Type                       : JP2
MIME Type                       : image/jp2
Major Brand                     : JPEG 2000 Image (.JP2)
Minor Version                   : 0.0.0
Compatible Brands               : jp2
Image Height                    : 2675
Image Width                     : 1745
Number Of Components            : 3
Bits Per Component              : 16 Bits, Unsigned
Compression                     : JPEG 2000
Color Spec Method               : Enumerated
Color Spec Precedence           : 0
Color Spec Approximation        : Not Specified
Color Space                     : sRGB
Image Size                      : 1745x2675

If I save a jp2 picture with digikam, then the metadata is displayed. But if I create a jp2 for example with "convert -depth 14 -quality 80 -resize 10% img.jp2 img_small.jp2" then the resulting picture does not show up any metadata. I attach this resulting picture to this bugreport.
Comment 3 Ulrich Eckhardt 2016-03-19 12:19:11 UTC
Created attachment 97969 [details]
Generated jp2000
Comment 4 caulier.gilles 2016-03-19 12:52:02 UTC
Ulrich,

The informations displayed by Exiftool are just image pixels properties. This is not the real image metadata, know as Exif, Iptc, and XMP.

The way that digiKam save to new JPG2000 has visibile metadata, is that digiKAm genrate basic Exif, Iptc and XMP from image properties + digiKam properties. That all.

The problem about the null thumbnail is simple. With JPEG2000, we don't load full image to render thumb, as JPEG for ex. IPTC as a properties to store a dedicated image preview that we use instead to render thumb. In your case, no IPTC = no thumb.

Why not to load full JPEG2000 image to render thumb ? simple : jasper library used to decode JPEG2000 is old, not maintained and generated a lot of non catch-able exception which crash digiKam as well. 

The alternative to this problem is to use http://www.openjpeg.org/ instead. But rewriting JPEG 2000 decoder is a non trivial task, and require time to do...

Alternative to JPEG2000 : PGF or WebP. Both use wavelets compression. The first one is fully supported to digiKam. The second one must be implemented.

Gilles Caulier
Comment 5 caulier.gilles 2016-07-06 16:30:48 UTC
This file still valid using last digiKam 5.0.0 ?

Gilles Caulier
Comment 6 Ulrich Eckhardt 2016-07-12 18:12:06 UTC
Seems still valid.

I couldn’t find an official digikam5 package for OpenSUSE 13.2 and I was also not able to compile it there due to missing dependencys. But I found a repository by wolfi. There the problem is still present.
Comment 7 caulier.gilles 2016-11-25 20:25:52 UTC
What's about this file using digiKam AppImage bundle 5.4.0 pre release given at
this url :

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Gilles Caulier
Comment 8 Ulrich Eckhardt 2017-02-06 12:57:20 UTC
After upgrading my system I could now test this problem against digikam 5.4. There the problem is still present. I have also tested this now with the appimage for pre 5.5 found on your link. There the problem is also present.
Comment 9 caulier.gilles 2017-02-06 16:47:00 UTC
Run the AppImage 5.5.0 from a console, go to an album with JP2 image and press F5 to force to rebuild thumbs. Report all traces from the console in this file.

Gilles Caulier
Comment 10 Ulrich Eckhardt 2017-02-07 09:27:40 UTC
Created attachment 103876 [details]
Full log of AppImage 5.5.0 from a console

The following output could be seen on the console (a full log including startup is attached).

digikam.general: Event is dispatched to KDE desktop notifier
digikam.general: Using  8  CPU core to run threads
digikam.general: Action Thread run  4  new jobs
digikam.general: scan mode: ScheduleCollectionScan ::  ("/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/")
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_05.jp2"  : JPEG2000 file identified
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_03.jp2"  : JPEG2000 file identified
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_02.jp2"  : JPEG2000 file identified
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_04.jp2"  : JPEG2000 file identified
digikam.general: Event is dispatched to KDE desktop notifier
digikam.geoiface: ----
digikam.general: Using  8  CPU core to run threads
digikam.general: Action Thread run  1  new jobs
digikam.general: Cancel Main Thread
digikam.general: One job is done
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_02.jp2"  : JPEG2000 file identified
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_02.jp2"  : JPEG2000 file identified
digikam.dimg: LCMS internal error: cannot create a color transform instance
digikam.general: One job is done
digikam.dimg: LCMS internal error: cannot create a color transform instance
digikam.dimg: LCMS internal error: cannot create a color transform instance
digikam.general: One job is done
digikam.dimg: LCMS internal error: cannot create a color transform instance
digikam.dimg: LCMS internal error: cannot create a color transform instance
digikam.general: One job is done
digikam.general: One job is done
digikam.general: List of Pending Jobs is empty
digikam.general: Event is dispatched to KDE desktop notifier
digikam.general: Cancel Main Thread
digikam.general: Cancel Main Thread
digikam.dimg: LCMS internal error: cannot create a color transform instance
Comment 11 caulier.gilles 2017-02-07 09:37:55 UTC
digikam.dimg: LCMS internal error: cannot create a color transform instance

Color Management is enabled with thumbnails view. This is broken (wrong CM settings in digiKam ?)

Disable CM and try again.

Gilles Caulier
Comment 12 Ulrich Eckhardt 2017-02-07 09:53:13 UTC
Disabling color management does not change anything. Could you give me a hint, which file is responsible for loading jpeg2000 maybe I could do some debugging.

Log without color management:
kipi.plugins: Reading data from kipirc file..
digikam.geoiface: ----
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_02.jp2"  : JPEG2000 file identified
QFSFileEngine::open: No file name specified
digikam.geoiface: "setting backend marble"
digikam.geoiface: "ROADMAP"
digikam.facesengine: Face database ready for use
digikam.general: Face PipeLine: add database writer
digikam.general: Face PipeLine: add faces trainer
digikam.facesengine: Face database ready for use
digikam.general: Face PipeLine: add database writer
digikam.general: Face PipeLine: add faces trainer
QFSFileEngine::open: No file name specified
digikam.geoiface: "setting backend marble"
digikam.geoiface: "ROADMAP"
digikam.geoiface: "setting backend marble"
digikam.geoiface: "ROADMAP"
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_03.jp2"  : JPEG2000 file identified
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_04.jp2"  : JPEG2000 file identified
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_05.jp2"  : JPEG2000 file identified
digikam.general: scan mode: ScanDeferredFiles
digikam.general: total scan value :  60346
digikam.database: Broken history: Same file referred by different entries. Refusing to add a loop.
digikam.database: items to tag ()
digikam.database: Complete scan took: 725 msecs.
digikam.general: Event is dispatched to KDE desktop notifier
digikam.general: Using  8  CPU core to run threads
digikam.general: Action Thread run  4  new jobs
digikam.general: scan mode: ScheduleCollectionScan ::  ("/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/")
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_03.jp2"  : JPEG2000 file identified
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_04.jp2"  : JPEG2000 file identified
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_02.jp2"  : JPEG2000 file identified
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_05.jp2"  : JPEG2000 file identified
digikam.general: Event is dispatched to KDE desktop notifier
digikam.geoiface: ----
digikam.general: Using  8  CPU core to run threads
digikam.general: Action Thread run  1  new jobs
digikam.general: Cancel Main Thread
digikam.general: One job is done
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_02.jp2"  : JPEG2000 file identified
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_02.jp2"  : JPEG2000 file identified
digikam.general: One job is done
digikam.general: One job is done
digikam.general: Trying to load Embedded preview with libraw
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.rawengine: Failed to load embedded RAW preview
digikam.general: Trying to load half preview with libraw
digikam.general: Trying to load Embedded preview with Exiv2
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_04.jp2"  : JPEG2000 file identified
digikam.dimg: "/home/uli/dvd/dvd1992-1994/92_1/original/Mitgliederversammlung_09.02/img_2_04.jp2"  : JPEG2000 file identified
digikam.general: One job is done
digikam.general: One job is done
digikam.general: List of Pending Jobs is empty
digikam.general: Event is dispatched to KDE desktop notifier
digikam.general: Cancel Main Thread
digikam.general: Cancel Main Thread
Comment 13 Ulrich Eckhardt 2017-02-07 10:11:47 UTC
I have added the following printf statement at the end of jp2kloader.cpp (around line 570), and there the image width and height is always printed correctly:

    jas_cleanup();
fprintf(stderr, "**** jp2kloader %d %d\n", imageWidth(), imageHeight());
    return true;
}
Comment 14 caulier.gilles 2017-02-07 10:14:11 UTC
Can you share some JP2 sample to try to reproduce here... Please use a cloud web service please ?

Gilles Caulier
Comment 15 Ulrich Eckhardt 2017-02-07 10:36:06 UTC
Created attachment 103879 [details]
Screenshot of DigiKam showing size 0x0

I could see this problem here with the jp2 image already attached to this bugreport (Generated jp2000) https://bugs.kde.org/attachment.cgi?id=97969.

I have attached a screenshot how this attachment looks at my DigiKam.

Also sometimes the AppImage 5.5 DigiKam crashes when refreshing a view:
#0  0x00007fffedd3c8d7 in raise () from /lib64/libc.so.6
#1  0x00007fffedd3dcaa in abort () from /lib64/libc.so.6
#2  0x00007fffedd7a1b4 in __libc_message () from /lib64/libc.so.6
#3  0x00007fffedd7f9d6 in malloc_printerr () from /lib64/libc.so.6
#4  0x00007fffedd80723 in _int_free () from /lib64/libc.so.6
#5  0x00007fffee695b08 in std::string::_M_mutate(unsigned long, unsigned long, unsigned long) () from /usr/lib64/libstdc++.so.6
#6  0x00007fffee695fce in std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) () from /usr/lib64/libstdc++.so.6
#7  0x00000033b5f6a211 in std::string::assign (__s=<optimized out>, this=<optimized out>)
    at /opt/rh/devtoolset-3/root././/include/c++/4.9.2/bits/basic_string.h:1149
#8  std::string::operator= (__s=<optimized out>, this=<optimized out>) at /opt/rh/devtoolset-3/root././/include/c++/4.9.2/bits/basic_string.h:563
#9  Exiv2::tagName (nMaxLength=<optimized out>, tag=<optimized out>) at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/image.cpp:289
#10 Exiv2::Image::printIFDStructure (this=<optimized out>, io=..., out=..., option=<optimized out>, start=<optimized out>, bSwap=<optimized out>, 
    c=77 'M', depth=<optimized out>) at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/image.cpp:403
#11 0x00000033b5f6c463 in Exiv2::Image::printTiffStructure (this=<optimized out>, io=..., out=..., option=<optimized out>, depth=<optimized out>, 
    offset=<optimized out>) at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/image.cpp:503
#12 0x00000033b5fed6b3 in Exiv2::TiffImage::printStructure (this=<optimized out>, out=..., option=<optimized out>, depth=<optimized out>)
    at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/tiffimage.cpp:348
#13 0x00000033b5feed93 in Exiv2::TiffImage::readMetadata (this=<optimized out>) at /b/ext_exiv2/ext_exiv2-prefix/src/ext_exiv2/src/tiffimage.cpp:191
#14 0x00007ffff67d7126 in Digikam::MetaEngine::load (this=this@entry=0x7ffec2ffc910, filePath=...)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/dmetadata/metaengine.cpp:280
#15 0x00007ffff681f986 in Digikam::DMetadata::load (this=this@entry=0x7ffec2ffc910, filePath=...)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/dmetadata/dmetadata.cpp:96
#16 0x00007ffff681fa02 in Digikam::DMetadata::DMetadata (this=0x7ffec2ffc910, filePath=...)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/dmetadata/dmetadata.cpp:63
#17 0x00007ffff6869661 in Digikam::ThumbnailCreator::createThumbnail (this=this@entry=0x1ecac10, info=..., detailRect=...)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailcreator.cpp:469
#18 0x00007ffff686c687 in Digikam::ThumbnailCreator::load (this=0x1ecac10, identifier=..., rect=..., pregenerate=pregenerate@entry=false)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailcreator.cpp:264
#19 0x00007ffff686cea2 in Digikam::ThumbnailCreator::load (this=<optimized out>, identifier=...)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailcreator.cpp:181
#20 0x00007ffff687782e in Digikam::ThumbnailLoadingTask::execute (this=0x7ffeac076800)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailtask.cpp:166
#21 0x00007ffff68503d2 in Digikam::LoadSaveThread::run (this=0x43b1dd0)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/loadsavethread.cpp:133
#22 0x00007ffff688e42e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x43b16f0)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threads/dynamicthread.cpp:183
#23 0x00000031e02abf8d in ?? () from /tmp/.mount_1ZD8h0/usr/lib/libQt5Core.so.5
#24 0x00000031e02aef49 in ?? () from /tmp/.mount_1ZD8h0/usr/lib/libQt5Core.so.5
#25 0x00007ffff5f9d734 in start_thread () from /lib64/libpthread.so.0
#26 0x00007fffeddf1d3d in clone () from /lib64/libc.so.6
Comment 16 Ulrich Eckhardt 2017-02-07 10:42:34 UTC
Here is an other backtrace of a core. I am not sure if the first one was really the crash, there was probably an exception.

Thread 56 "Thread (pooled)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffecf7fe700 (LWP 12696)]
0x00007fffedd83c04 in free () from /lib64/libc.so.6
Missing separate debuginfos, use: zypper install fontconfig-debuginfo-2.11.1-2.2.x86_64 glibc-debuginfo-2.22-3.7.x86_64 libX11-6-debuginfo-1.6.3-7.1.x86_64 libXcursor1-debuginfo-1.1.14-7.3.x86_64 libdbus-1-3-debuginfo-1.8.22-1.1.x86_64 libexpat1-debuginfo-2.1.0-17.9.x86_64 libgcc_s1-gcc6-debuginfo-6.2.1+r239768-3.3.x86_64 libglib-2_0-0-debuginfo-2.48.2-1.10.x86_64 libgpg-error0-debuginfo-1.13-4.19.x86_64 libpcre1-debuginfo-8.39-6.1.x86_64 libstdc++6-gcc6-debuginfo-6.2.1+r239768-3.3.x86_64 libxcb1-debuginfo-1.11.1-2.25.x86_64 libz1-debuginfo-1.2.8-10.1.x86_64
(gdb) bt
#0  0x00007fffedd83c04 in free () from /lib64/libc.so.6
#1  0x00000033b200f52e in jas_image_clearfmts () from /tmp/.mount_oWT4Ia/usr/lib/libjasper.so.4
#2  0x00007ffff665c9fa in Digikam::JP2KLoader::load (this=this@entry=0x7ffecf7fd5d0, filePath=..., observer=observer@entry=0x7ffe94015e30)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/dimg/loaders/jp2kloader.cpp:568
#3  0x00007ffff67b46dc in Digikam::DImg::load (this=this@entry=0x7ffecf7fd740, filePath=..., loadFlagsInt=13, observer=observer@entry=0x7ffe94015e30, 
    rawDecodingSettings=...) at /b/dktemp/digikam-development/garbagecollection/core/libs/dimg/dimg.cpp:518
#4  0x00007ffff67b4f6a in Digikam::DImg::load (this=this@entry=0x7ffecf7fd740, filePath=..., loadMetadata=loadMetadata@entry=false, 
    loadICCData=<optimized out>, loadUniqueHash=loadUniqueHash@entry=false, loadImageHistory=loadImageHistory@entry=false, observer=0x7ffe94015e30, 
    rawDecodingSettings=...) at /b/dktemp/digikam-development/garbagecollection/core/libs/dimg/dimg.cpp:398
#5  0x00007ffff68679f3 in Digikam::ThumbnailCreator::loadWithDImg (this=this@entry=0x441cab0, path=..., profile=profile@entry=0x7ffecf7fd820)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailcreator.cpp:603
#6  0x00007ffff6869efd in Digikam::ThumbnailCreator::createThumbnail (this=this@entry=0x441cab0, info=..., detailRect=...)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailcreator.cpp:561
#7  0x00007ffff686c687 in Digikam::ThumbnailCreator::load (this=0x441cab0, identifier=..., rect=..., pregenerate=pregenerate@entry=false)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailcreator.cpp:264
#8  0x00007ffff686cea2 in Digikam::ThumbnailCreator::load (this=<optimized out>, identifier=...)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailcreator.cpp:181
#9  0x00007ffff687782e in Digikam::ThumbnailLoadingTask::execute (this=0x7ffe94015e20)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/thumbnailtask.cpp:166
#10 0x00007ffff68503d2 in Digikam::LoadSaveThread::run (this=0x396a270)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threadimageio/loadsavethread.cpp:133
#11 0x00007ffff688e42e in Digikam::DynamicThread::DynamicThreadPriv::run (this=0x39695e0)
    at /b/dktemp/digikam-development/garbagecollection/core/libs/threads/dynamicthread.cpp:183
#12 0x00000031e02abf8d in ?? () from /tmp/.mount_oWT4Ia/usr/lib/libQt5Core.so.5
#13 0x00000031e02aef49 in ?? () from /tmp/.mount_oWT4Ia/usr/lib/libQt5Core.so.5
#14 0x00007ffff5f9d734 in start_thread () from /lib64/libpthread.so.0
#15 0x00007fffeddf1d3d in clone () from /lib64/libc.so.6
Comment 17 Maik Qualmann 2017-02-07 11:24:18 UTC
We do not load JP2 images during scanning new images, see comment, therefore 0x0 size.

https://cgit.kde.org/digikam.git/tree/libs/dimg/loaders/jp2kloader.cpp#n97

Maik
Comment 18 caulier.gilles 2017-02-07 16:52:59 UTC
The exception is generated by libjasper:

#1  0x00000033b200f52e in jas_image_clearfmts () from
/tmp/.mount_oWT4Ia/usr/lib/libjasper.so.4

So, the way to decode image from jp2kloader.cpp must wrap C++ exception when it's possible... or it's a bug in Jasper library.

Gilles Caulier
Comment 19 caulier.gilles 2017-02-07 16:55:06 UTC
As i can see, the japser API is not wrapper by C++ exception handler (as with Exiv2 and dmetadata interface). This is why digiKam crash.

https://cgit.kde.org/digikam.git/tree/libs/dimg/loaders/jp2kloader.cpp

We must add C++ exception catch in this class...

Gilles Caulier
Comment 20 caulier.gilles 2020-08-02 13:22:57 UTC
digiKam 7.0.0 stable release is now published:

https://www.digikam.org/news/2020-07-19-7.0.0_release_announcement/

We need a fresh feedback on this file using this version.

Best Regards

Gilles Caulier
Comment 21 Ulrich Eckhardt 2020-08-04 16:26:33 UTC
I have retested this problem with the 7.0.0 app-image on a SuSE Leap 15.2. The problem is still present. The Exif information is not displayed and the Image dimension is displayed with 0x0. I have reproduced this with either the attached jp2 and a lot of jp2 files of my album. I had refreshed the display also with F5.

At the Console the following was displayed:
Digikam::ActionThreadBase::slotJobFinished: One job is done
Digikam::ActionThreadBase::cancel: Cancel Main Thread
Digikam::ActionThreadBase::cancel: Cancel Main Thread
Digikam::PreviewLoadingTask::execute: Try to get preview from "/home/uli/dvd2000/tmp/img_small.jp2"
Digikam::PreviewLoadingTask::execute: Preview quality:  0
Digikam::PreviewLoadingTask::loadImagePreview: Try to load DImg preview from: "/home/uli/dvd2000/tmp/img_small.jp2"
Digikam::DImg::load: "/home/uli/dvd2000/tmp/img_small.jp2" : "JPEG2000" file identified
Digikam::StackedView::setViewMode: Stacked View Mode :  1
Digikam::PreviewLoadingTask::execute: Try to get preview from "/home/uli/dvd2000/tmp/img_test.jp2"
Digikam::PreviewLoadingTask::execute: Preview quality:  0
Digikam::PreviewLoadingTask::loadImagePreview: Try to load DImg preview from: "/home/uli/dvd2000/tmp/img_test.jp2"
Digikam::DImg::load: "/home/uli/dvd2000/tmp/img_test.jp2" : "JPEG2000" file identified
Digikam::MetaEnginePreviews::data: index     :  0
Digikam::MetaEnginePreviews::data: properties:  3
Comment 22 caulier.gilles 2021-04-24 09:46:15 UTC
Maik, 

Another candidate for ExifTool. I tried to reproduce the problem with the JP2 sample image in DK 7.3.0, and it's always valid :

https://imgur.com/B9XhdZw

But ExifTool report the right values about this image:

File name: img_small.jp2 (ExifTool)

>>> Composite <<<

ImageSize : 209 140
Megapixels : 0.02926


>>> File <<<

Directory : /home/gilles/Images
FileAccessDate : 2021:04:24 11:40:31+02:00
FileInodeChangeDate : 2021:04:24 11:40:31+02:00
FileModifyDate : 2021:04:24 11:40:17+02:00
FileName : img_small.jp2
FilePermissions : 664
FileSize : 88703
FileType : JP2
FileTypeExtension : JP2
MIMEType : image/jp2


>>> Jpeg2000 <<<

BitsPerComponent : 13
ColorSpace : 16
ColorSpecApproximation : 0
ColorSpecMethod : 1
ColorSpecPrecedence : 0
CompatibleBrands : 
Compression : 7
ImageHeight : 140
ImageWidth : 209
MajorBrand : jp2
MinorVersion : 0.0.0
NumberOfComponents : 3
Comment 23 caulier.gilles 2021-04-26 08:58:57 UTC
Git commit b3c56d4cdedb4ad83c7baca89c32d011f1738090 by Gilles Caulier.
Committed on 26/04/2021 at 08:58.
Pushed by cgilles into branch 'master'.

Use EXV container to translate automatically all metadata from ExifTool to Exiv2
Related: bug 426938, bug 421464, bug 416516

M  +23   -76   core/libs/metadataengine/exiftool/exiftoolparser.cpp
M  +2    -5    core/libs/metadataengine/exiftool/exiftoolparser.h
M  +13   -38   core/tests/metadataengine/exiftool/exiftoolexport_cli.cpp

https://invent.kde.org/graphics/digikam/commit/b3c56d4cdedb4ad83c7baca89c32d011f1738090
Comment 24 caulier.gilles 2021-04-26 09:07:06 UTC
Git commit 183a05476b1fa485e5143e0bb28d84e3a8daa471 by Gilles Caulier.
Committed on 26/04/2021 at 09:08.
Pushed by cgilles into branch 'master'.

Remove obsolete ExifToolTranslator class. We use now the auto conversion to Exiv2 through EXV container processed by ExivTool
Related: bug 426938, bug 421464, bug 416516

M  +0    -6    core/libs/metadataengine/CMakeLists.txt
M  +10   -114  core/libs/metadataengine/exiftool/exiftoolparser.cpp
D  +0    -81   core/libs/metadataengine/exiftool/exiftooltranslator.cpp
D  +0    -65   core/libs/metadataengine/exiftool/exiftooltranslator.h
D  +0    -196  core/libs/metadataengine/exiftool/exiftooltranslator_exif.cpp
D  +0    -51   core/libs/metadataengine/exiftool/exiftooltranslator_ignoredgroups.cpp
D  +0    -164  core/libs/metadataengine/exiftool/exiftooltranslator_iptc.cpp
D  +0    -76   core/libs/metadataengine/exiftool/exiftooltranslator_p.cpp
D  +0    -73   core/libs/metadataengine/exiftool/exiftooltranslator_p.h
D  +0    -439  core/libs/metadataengine/exiftool/exiftooltranslator_xmp.cpp
M  +0    -1    core/libs/widgets/metadata/exiftool/exiftoollistview.cpp
M  +0    -1    core/tests/metadataengine/exiftool/CMakeLists.txt
D  +0    -318  core/tests/metadataengine/exiftool/exiftoolxmldb_cli.cpp

https://invent.kde.org/graphics/digikam/commit/183a05476b1fa485e5143e0bb28d84e3a8daa471
Comment 25 caulier.gilles 2021-04-26 11:01:26 UTC
Git commit 5b097916d8bfa42fef5a2966fa3b34d0793cf0e2 by Gilles Caulier.
Committed on 26/04/2021 at 11:02.
Pushed by cgilles into branch 'master'.

separate ExitTool parser and process classes internal container implementations
Related: bug 426938, bug 416516

M  +2    -0    core/libs/metadataengine/CMakeLists.txt
M  +15   -154  core/libs/metadataengine/exiftool/exiftoolparser.cpp
M  +0    -11   core/libs/metadataengine/exiftool/exiftoolparser.h
A  +132  -0    core/libs/metadataengine/exiftool/exiftoolparser_p.cpp     [License: GPL (v2+)]
A  +83   -0    core/libs/metadataengine/exiftool/exiftoolparser_p.h     [License: GPL (v2+)]
M  +10   -209  core/libs/metadataengine/exiftool/exiftoolprocess.cpp
M  +10   -20   core/libs/metadataengine/exiftool/exiftoolprocess.h
A  +171  -0    core/libs/metadataengine/exiftool/exiftoolprocess_p.cpp     [License: GPL (v2+)]
A  +107  -0    core/libs/metadataengine/exiftool/exiftoolprocess_p.h     [License: GPL (v2+)]
M  +0    -1    core/tests/metadataengine/exiftool/exiftoolmulticore_cli.cpp
M  +0    -1    core/tests/metadataengine/exiftool/exiftooloutput_cli.cpp
M  +1    -1    core/tests/metadataengine/exiftool/exiftoolparserout_cli.cpp

https://invent.kde.org/graphics/digikam/commit/5b097916d8bfa42fef5a2966fa3b34d0793cf0e2
Comment 26 caulier.gilles 2022-04-06 20:54:01 UTC
Git commit febc26188fe4e6037e5c8a9b1840f65729972a47 by Gilles Caulier.
Committed on 06/04/2022 at 20:38.
Pushed by cgilles into branch 'master'.

Add ExifTool backend to load metadata for image or video.
Exiv2 is always used in priority. If it fail, ExifTool is used instead.
ExifTool has the capability to create an EXV container for Exiv2. All metadata extracted with ExifTool
are concatened to the EXV container with all possible translations with Exif, Iptc, and Xmp tags.
Of course tags supported by ExifTool but not supported by Exiv2 are lost.
Related: bug 385726, bug 416516, bug 264210, bug 426938, bug 419801, bug 419375, bug 103247

M  +1    -0    core/libs/metadataengine/CMakeLists.txt
M  +7    -0    core/libs/metadataengine/dmetadata/dmetadata.h
A  +94   -0    core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp     [License: GPL (v2+)]
M  +42   -17   core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp
M  +7    -6    core/libs/metadataengine/engine/metaengine.h
M  +5    -0    core/libs/metadataengine/engine/metaengine_fileio.cpp
M  +4    -2    core/libs/metadataengine/exiftool/exiftoolparser_command.cpp

https://invent.kde.org/graphics/digikam/commit/febc26188fe4e6037e5c8a9b1840f65729972a47
Comment 27 caulier.gilles 2023-04-21 05:56:57 UTC
@Ulrich

digiKam 8.0.0 is released. This file still valid ?

Gilles Caulier
Comment 28 Ulrich Eckhardt 2023-04-22 15:07:54 UTC
Created attachment 158326 [details]
Screenshot digiKam 8.0.0 showing the size 0x0

I have retested this problem with the 8.0.0 app-image on a SuSE Leap 15.4. The problem is still present. The Image dimension is displayed still with 0x0. The ExitTool Tab shows the image size. I have reproduced this with either the attached jp2 and a lot of jp2 files of my album. I had refreshed the display also with F5. I attach a screen shot of the current display.
Comment 29 caulier.gilles 2023-04-22 15:25:29 UTC
F5 is not enough. Your must re-read metadata from image to store on database. Remember that image info are cached in database to prevent to re-read image data which an be time consuming. 

Use menu entry Item/Reread metadata from File.

Gilles Caulier
Comment 30 Ulrich Eckhardt 2023-04-23 15:27:55 UTC
Comment on attachment 97969 [details]
Generated jp2000

I have reread the metadata and also copied the example image manually to a new folder. But the problem still persists.
Comment 31 Maik Qualmann 2023-04-23 19:43:36 UTC
Git commit 0f90a22e71b36c95aed5a200a17a8e5ec80fd46e by Maik Qualmann.
Committed on 23/04/2023 at 19:40.
Pushed by mqualmann into branch 'master'.

with libjasper >= 3 we read the image metadata
The broken test samples from libjasper repository are processed without crashing.
FIXED-IN: 8.1.0

M  +1    -1    NEWS
M  +20   -1    core/dplugins/dimg/jpeg2000/dimgjpeg2000loader_load.cpp

https://invent.kde.org/graphics/digikam/commit/0f90a22e71b36c95aed5a200a17a8e5ec80fd46e