Bug 382174 - Not creating thumbnails and not editing (F4) files created for Samsung panorama jpgs [patch]
Summary: Not creating thumbnails and not editing (F4) files created for Samsung panora...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-JPEG (show other bugs)
Version: 5.9.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-09 20:41 UTC by Mathias
Modified: 2018-07-06 10:39 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.0
Sentry Crash Report:


Attachments
crash after opening files (27.07 KB, image/png)
2017-07-09 20:41 UTC, Mathias
Details
jpegLoader.patch (2.64 KB, patch)
2018-07-03 06:02 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias 2017-07-09 20:41:01 UTC
Created attachment 106523 [details]
crash after opening files

I've created some panorama pictures with my Android phone (Samsung Galaxy S7) with the build in panorama mode. The pictures are displayed in digiKam without a thumb. After double clicking on the image or using the context menu --> open the application crashes.
Picture works fine with win10 image viewer.
Comment 1 caulier.gilles 2017-07-09 20:55:25 UTC
Can you share through the cloud your JPEG file for investigations ?

Gilles Caulier
Comment 3 caulier.gilles 2017-07-10 21:39:26 UTC
Fully reproducible :

digikam.general: scan mode: ScheduleCollectionScan ::  ("/mnt/data/TEST_IMAGES/")
digikam.dimg: "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"  : JPEG file identified
digikam.dimg: "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"  : QIMAGE file identified
Invalid SOS parameters for sequential JPEG
digikam.general: Event is dispatched to desktop notifier through DBUS
digikam.dimg: "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"  : JPEG file identified
digikam.metaengine: DateTime => Exif.Photo.DateTimeOriginal =>  QDateTime(2017-07-04 14:50:55.000 CEST Qt::TimeSpec(LocalTime))
digikam.metaengine: Cannot find Exif key 'Xmp.exif.ISOSpeedRatings' into image using Exiv2   (Error # 6 :  Invalid key `Xmp.exif.ISOSpeedRatings'
digikam.metaengine: Cannot find Exif key 'Xmp.exif.ExposureIndex' into image using Exiv2   (Error # 6 :  Invalid key `Xmp.exif.ExposureIndex'
digikam.metaengine: XMP String Seq ( Xmp.digiKam.TagsList ):  ("2017", "Sommer", "Juli", "Friends", "Urlaub", "Landschaft", "Stadt", "Tschechien", "Juni", "Prag")
Unsupported marker type 0x65
digikam.dimg.qimage: Can not load " "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg" " using DImg::QImageLoader!
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: "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"  : JPEG file identified
digikam.dimg: "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"  : QIMAGE file identified
Invalid SOS parameters for sequential JPEG
Unsupported marker type 0x65
digikam.dimg.qimage: Can not load " "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg" " using DImg::QImageLoader!
digikam.general: Cannot create thumbnail for  "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"
digikam.general: Thumbnail is null for  "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"
digikam.general: Request to get thumbnail for  "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"
digikam.general: Mime type is not video or audio/mpeg from  "20170702_Prag-1140.jpg"
digikam.general: Failed to extract video thumbnail for  "/mnt/data/TEST_IMAGES/20170702_Prag-1140.jpg"

The JPEG file has a unknown marker that libjpeg cannot decode.

Gilles Caulier
Comment 4 caulier.gilles 2017-07-10 21:40:07 UTC
Note : i tested under Linux, but under Windows we use the same libjpeg library
Comment 5 caulier.gilles 2017-07-11 03:58:46 UTC
The problem is reproducible with all Gimp and other application based on open source libjpeg (all under Linux)

Nothing can be done on digiKam source code to fix the problem. Libjpeg must be fixed as well.

Please report this problem to libjpeg turbo team as UPSTREAM :

 https://github.com/libjpeg-turbo/libjpeg-turbo

Thanks in advance

Gilles Caulier
Comment 6 Mathias 2017-08-09 10:41:51 UTC
Thanks for your help.
I've just opened an new issue here
https://github.com/libjpeg-turbo/libjpeg-turbo/issues/163
Comment 7 Mathias 2017-08-09 15:10:36 UTC
Could you please verify if the issue is fixed with the latest build of libjpeg?

This is the answer of the issue from the libjpeg-bugtracker:
It decodes with no errors for me using the latest libjpeg-turbo code. I tried with both the libjpeg API (djpeg) and the TurboJPEG API (tjbench.) In order for me to pursue this as a bug against libjpeg-turbo, it needs to be reproducible using only our code.

Thanks :)
Comment 8 Simon 2017-08-18 15:56:02 UTC
I just built libjpeg-turbo from source and reproduced the problem, the ball is back with upstream.
Comment 9 Simon 2017-08-18 16:36:50 UTC
And the ball is back with us. Here is the response by the upstream maintainer:

> [...]
> 
> Regardless, this is not a bug in libjpeg-turbo. libjpeg-turbo is printing a
> warning that it encountered a JFIF marker it doesn't understand. The default
> behavior of the library is to continue decoding the image when such a warning
> is encountered. Applications are free to ignore those warnings or to treat
> them as fatal. Both can be accomplished by creating a custom error manager
> using the libjpeg API, and modifications to the TurboJPEG API in dev/1.6
> evolving make it possible to ignore warnings or treat them as fatal in that
> API as well.
> 
> Thus, there isn't anything we can do about this. If digiKam is treating the
> warning as fatal, then digiKam needs to be modified. Otherwise, if digiKam is
> continuing to decode the image after the warning, then it's a non-issue.
> 
> [...]
Comment 10 Rafael Linux User 2018-07-02 13:11:45 UTC
I must say that I think is a Digikam related issue (at least, in Linux - OpenSUSE). I have S8 panoramas, Digikam 5.9 doesn't show their thumbnails, however Gwenview does it. GIMP is able to open the images without problems (but asking about rotate image) and Digikam do not crash, but doesn't not generate the thumbanils nor let user to edit with Showphoto (show an error opening the file).

Any solution?
Comment 11 Maik Qualmann 2018-07-03 06:02:15 UTC
Created attachment 113730 [details]
jpegLoader.patch

This patch would load the image from the Samsung camera now. This patch then uses the previously loaded image data after a fatal libjpeg error. Also Bug 376124 and Bug 386188 would be fixed.

Maik
Comment 12 Maik Qualmann 2018-07-03 10:38:38 UTC
Git commit 84265d4d457e9c96ffab49342a3201cb79212c16 by Maik Qualmann.
Committed on 03/07/2018 at 10:37.
Pushed by mqualmann into branch 'master'.

use already read image data up to libjpeg error
Related: bug 376124, bug 386188
FIXED-IN: 6.0.0

M  +4    -1    NEWS
M  +51   -10   core/libs/dimg/loaders/jpegloader.cpp

https://commits.kde.org/digikam/84265d4d457e9c96ffab49342a3201cb79212c16
Comment 13 Rafael Linux User 2018-07-04 13:32:14 UTC
I tried just with the appimage version 6 and with 5 panoramas, all of them took with Samsung S8. It can read 3 of them, but the other 2 are not readable by Digikam.
Comment 14 caulier.gilles 2018-07-04 13:52:40 UTC
Wait a minute,

I currently rebuild the 6.0.0 pre-release AppImage bundle. It will be only in
one hour. Please try again with this version.


Gilles Caulier
Comment 15 Maik Qualmann 2018-07-05 05:49:59 UTC
Git commit 2e885007206da2bc608ea7494c6cd2fdedba6c9f by Maik Qualmann.
Committed on 05/07/2018 at 05:48.
Pushed by mqualmann into branch 'master'.

fix crash with Samsung S8 panoramas

M  +7    -2    core/libs/dimg/loaders/jpegloader.cpp

https://commits.kde.org/digikam/2e885007206da2bc608ea7494c6cd2fdedba6c9f
Comment 16 Maik Qualmann 2018-07-05 05:51:33 UTC
Gilles,

can you please update the AppImage, I had tested it only with Samsung S7 test images.

Maik
Comment 17 Rafael Linux User 2018-07-05 10:34:17 UTC
I test you latest bundle appimage, but unfortunately, now is worst: Digikam crash if there is some S8 panorama in the album.
Anyway, I must say that Plasma itself doesn't show that panoramas thumbnails nor Dolphin. I'ts more, Gwenview "clone" the latest available thumbnail and attach it to the panorama images, but it can show the image when you click on it.
Comment 18 Rafael Linux User 2018-07-05 10:36:22 UTC
I tried to attach original photo, but is 16MiB size
Comment 19 Maik Qualmann 2018-07-05 10:43:34 UTC
Yes, I fixed that only this morning... wait for the next AppImage.

Maik
Comment 20 Maik Qualmann 2018-07-06 10:39:10 UTC
Rafael,

can you confirm that Samsung S8 panorama images now work with the current AppImage?

Maik