Bug 422279 - Repeatable crash when rotating
Summary: Repeatable crash when rotating
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Preview-Image (show other bugs)
Version: 7.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-31 02:33 UTC by David Griffiths
Modified: 2020-06-01 05:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments
Debug log when doing rotate (10.62 KB, text/plain)
2020-05-31 12:26 UTC, David Griffiths
Details
Debug log when doing rotate of a thumbnail. (76.37 KB, text/plain)
2020-06-01 00:13 UTC, David Griffiths
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Griffiths 2020-05-31 02:33:12 UTC
SUMMARY
Rotating image causes crash

STEPS TO REPRODUCE
1. View preview of this particular image
2. attempt to rotate right
3. 

OBSERVED RESULT
digiKam crashes

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: Win 10 Home

ADDITIONAL INFORMATION

V7.0.0 rc1

File is too large to attach (5MB). It is available here:
https://www.dropbox.com/sh/5vtq8yb94kabvow/AAARW7m5xInT5SddMhOoUfaNa?dl=0
Comment 1 Maik Qualmann 2020-05-31 06:24:01 UTC
Git commit 7a98463487996bc91b79e5ad67d307a7199e6c2b by Maik Qualmann.
Committed on 31/05/2020 at 06:21.
Pushed by mqualmann into branch 'master'.

polish and don't use QFileInfo::absolutePath()
QFileInfo::absolutePath() replaces "//" with "UNC",
this means that the file cannot be opened with fopen().

M  +5    -12   core/libs/jpegutils/jpegutils.cpp

https://invent.kde.org/graphics/digikam/commit/7a98463487996bc91b79e5ad67d307a7199e6c2b
Comment 2 Maik Qualmann 2020-05-31 06:38:33 UTC
I cannot reproduce a crash, neither on Linux nor on Windows. However, this JPG image is special, it cannot be rotated lossless. There is a slightly different but similar error message from libjpeg under Windows:

Empty JPEG image (DNL not supported)

-----
libjpeg doesn't support DNL markers in JPEG files. Files which contains such markers will declare to be of zero height.
-----

Maik
Comment 3 caulier.gilles 2020-05-31 06:55:19 UTC
yes, DNL (define-number-of-line) JPEG markers are not supported by libjpeg used in background by digiKam :

https://stackoverflow.com/questions/16470268/empty-jpeg-image-dnl-not-supported-node-canvas
Comment 4 Maik Qualmann 2020-05-31 07:06:33 UTC
I can sometimes reproduce the crash on Windows. The JPEG error handler doesn't always seem to work.

Maik
Comment 5 David Griffiths 2020-05-31 07:13:03 UTC
Since I loaded 7.0.0 rc1 it seems I cannot rotate any image, either as thumbnail or preview.
Comment 6 Maik Qualmann 2020-05-31 08:07:15 UTC
Git commit c8809100d8a3fb3f76433b79d16af83c4dd56398 by Maik Qualmann.
Committed on 31/05/2020 at 08:03.
Pushed by mqualmann into branch 'master'.

remove static declarations from error handlers

M  +0    -4    core/libs/jpegutils/jpegutils.cpp

https://invent.kde.org/graphics/digikam/commit/c8809100d8a3fb3f76433b79d16af83c4dd56398
Comment 7 Maik Qualmann 2020-05-31 08:22:48 UTC
No rotation works anymore? How exactly? Install the latest version from here:

https://files.kde.org/digikam/

1. Download "DebugView" from Microsoft.
2. Set this environment variable in the Windows editor for environment variables:

Variable: QT_LOGGING_RULES
Value: digikam.*=true

3. Start DebgugView and start digiKam. Try a rotation, send the log from DebugView.

Maik
Comment 8 David Griffiths 2020-05-31 12:26:28 UTC
Created attachment 128954 [details]
Debug log when doing rotate
Comment 9 Maik Qualmann 2020-05-31 17:01:56 UTC
The debug log contains hardly anything from digiKam. Setting the environment variable does not have to be correct.

Maik
Comment 10 Maik Qualmann 2020-05-31 18:57:19 UTC
Git commit e038d6662b77f1e5c0f868d824f3b3d8dd6e4240 by Maik Qualmann.
Committed on 31/05/2020 at 18:54.
Pushed by mqualmann into branch 'master'.

check for perfect JPEG transformation
We use the option for perfect JPEG transformation.
For images whose aspect ratio is not the correct
aspect ratio, a line would otherwise remain
without the trim option. In this case, we
perform a lossy rotation.
FIXED-IN: 7.0.0

M  +2    -1    NEWS
M  +12   -3    core/libs/jpegutils/jpegutils.cpp

https://invent.kde.org/graphics/digikam/commit/e038d6662b77f1e5c0f868d824f3b3d8dd6e4240
Comment 11 David Griffiths 2020-05-31 23:44:55 UTC
Do I need to install the debug version of digiKam? I'm guessing I do.
Comment 12 David Griffiths 2020-06-01 00:13:50 UTC
Created attachment 128964 [details]
Debug log when doing rotate of a thumbnail.

I think this is more like what you need. Using 7.0.0 rc1 debug.
Rotating the same image file I sent you earlier.
Comment 13 Maik Qualmann 2020-06-01 05:53:56 UTC
The digiKam debug version is not required for the text debug output.

Maik