Bug 366095 - Raw files not (always) properly decoded when using "raw data in half size" option for preview
Summary: Raw files not (always) properly decoded when using "raw data in half size" op...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Preview-RAW (show other bugs)
Version: 5.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL: https://postimg.org/image/ynsr9yt0h/
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-25 16:03 UTC by elfie.groslin
Modified: 2017-07-27 10:32 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description elfie.groslin 2016-07-25 16:03:35 UTC
When previewing raw files using the "raw data in half size" option, some images seem to be improperly decoded resulting in an unusable preview showing either stripes or squares.

This happens:
- For both NEF files and DNG files created from those NEF files using Adobe DNG converter
- For some pictures but not all of them
- Not always for the same pictures (which pictures are affected changes after restarting DigiKam)

Pictures look normal when opened in the image editor as shown on the image in the URL.

Using the embedded jpeg for previews works fine.

Reproducible: Sometimes

Steps to Reproduce:
1. Start DigiKam
2. Double click on thumbnail in album to bring up preview window
3. Select one thumbnail after the other in film strip to display previews until one of them fails to render properly

Actual Results:  
Raw preview either partially or fully covered by stripes or squares

Expected Results:  
Properly decode raw image

Digikam installer: digiKam-5.0.0-2-Win64.exe
Windows 8.1 Pro, 8GB RAM
Comment 1 caulier.gilles 2016-07-27 07:50:51 UTC
Can you share some RAW samples to test ? Please use a cloud repository to store, file, not bugzilla.

Thanks in advance

Gilles Caulier
Comment 2 elfie.groslin 2016-07-27 12:42:12 UTC
Sure. You'll find 4 raw files in this dropbox folder: 2 nef and 2 dng created from those nef using Adobe DNG Converter.

https://www.dropbox.com/sh/99hl1quyxfx1x67/AACvy_9AAmsT5SxyuzXEfjd5a?dl=0

I have those 4 files in a folder on my computer (nothing else in the folder). Every time I close DigiKam, start it again and preview those images I get different results, with one, two or three of the pictures not rendering properly (haven't managed yet to get all 4 to fail or all 4 to pass).

Each of the pictures has been properly rendered at least once and failed to render at least once.
Comment 3 caulier.gilles 2016-07-28 14:06:28 UTC
Git commit d0a60f5f02890de9e5a5a3e312511930f3cf72a5 by Gilles Caulier.
Committed on 28/07/2016 at 13:54.
Pushed by cgilles into branch 'master'.

Update internal Libraw to 0.18.0 beta (July 2016).

Move Libraw samples compilation rules to core/tests/rawengine. Theses samples
files are now only generated if test code are compiled through right CMake option.

Use DNG SDK source code to compile Libraw in goal to:
   - Decode DNG analog color balances
   - Decode DNG channel black/white level
   - 8-bit encoded DNG files
   - Deflate compressed DNG support with zlib

New features:
   - Support for Black and White Jpeg previews
   - Better intepolation of low-sensitivity pixels on Sigma Quattro files

New RAW cameras supported:
   - BlackMagic Micro Cinema Camera, URSA Mini
   - Canon 80D, 1300D, 1DX MkII
   - Fujifilm X-Pro2 (uncompressed RAW only), X70, X-E2S
   - HTC One A9 and M9
   - Leica M (Typ 262) and X-U (Typ 113)
   - Nikon D5
   - Olympus Pen F, SH-3
   - Panasonic DMC-GX80/85, DMC-TZ80/81/85/ZS60, DMC-TZ100/101/ZS100
   - PhaseOne IQ150, IQ180 IR, IQ3 (all models)
   - Samsung Galaxy S7 (SM-G935F)
   - Sony ILCA-68, ILCE-6300, RX1R II, RX10 III
   - YUNEEC CGO4
Related: bug 257737, bug 347010, bug 328321

M  +12   -0    NEWS
M  +32   -28   libs/rawengine/libraw/CMakeLists.txt
M  +5    -1    libs/rawengine/libraw/COPYRIGHT
M  +104  -0    libs/rawengine/libraw/Changelog.txt
M  +1    -1    libs/rawengine/libraw/crlf2lf.sh
M  +1752 -413  libs/rawengine/libraw/internal/dcraw_common.cpp
M  +2    -2    libs/rawengine/libraw/internal/dcraw_fileio.cpp
M  +10   -6    libs/rawengine/libraw/internal/defines.h
M  +2    -2    libs/rawengine/libraw/internal/demosaic_packs.cpp
D  +0    -142  libs/rawengine/libraw/internal/libraw_bytebuffer.h
M  +12   -2    libs/rawengine/libraw/internal/libraw_internal_funcs.h
M  +29   -29   libs/rawengine/libraw/internal/libraw_x3f.cpp
M  +1    -1    libs/rawengine/libraw/internal/var_defines.h
M  +98   -98   libs/rawengine/libraw/internal/wf_filtering.cpp
M  +43   -22   libs/rawengine/libraw/libraw/libraw.h
M  +3    -3    libs/rawengine/libraw/libraw/libraw_alloc.h
M  +89   -24   libs/rawengine/libraw/libraw/libraw_const.h
M  +61   -2    libs/rawengine/libraw/libraw/libraw_datastream.h
M  +19   -14   libs/rawengine/libraw/libraw/libraw_internal.h
M  +360  -166  libs/rawengine/libraw/libraw/libraw_types.h
M  +4    -4    libs/rawengine/libraw/libraw/libraw_version.h
M  +8    -8    libs/rawengine/libraw/samples/4channels.cpp
M  +46   -43   libs/rawengine/libraw/samples/dcraw_emu.cpp
M  +1    -1    libs/rawengine/libraw/samples/dcraw_half.c
M  +1    -1    libs/rawengine/libraw/samples/half_mt.c
M  +1    -1    libs/rawengine/libraw/samples/half_mt_win32.c
M  +9    -9    libs/rawengine/libraw/samples/mem_image.cpp
M  +6    -6    libs/rawengine/libraw/samples/multirender_test.cpp
M  +23   -23   libs/rawengine/libraw/samples/postprocessing_benchmark.cpp
M  +192  -11   libs/rawengine/libraw/samples/raw-identify.cpp
M  +10   -10   libs/rawengine/libraw/samples/simple_dcraw.cpp
M  +9    -9    libs/rawengine/libraw/samples/unprocessed_raw.cpp
M  +11   -3    libs/rawengine/libraw/src/libraw_c_api.cpp
M  +1150 -167  libs/rawengine/libraw/src/libraw_cxx.cpp
M  +86   -85   libs/rawengine/libraw/src/libraw_datastream.cpp
M  +43   -0    tests/rawengine/CMakeLists.txt

http://commits.kde.org/digikam/d0a60f5f02890de9e5a5a3e312511930f3cf72a5
Comment 4 caulier.gilles 2016-08-11 21:08:50 UTC
Elfie,

With last 5.1.0 release, internal Libraw have been updated to last 0.18 release and the dysfunction is not reproducible here. NEF and DNG are show without artifacts. I use Linux here.

Please try with last 5.1.0 Windows installer and give us a fresh feedback.

Thanks in advance.

Gilles Caulier
Comment 5 caulier.gilles 2016-08-15 20:45:03 UTC
Just tested under Windows. The dysfunction cannot be reproduced. 

I close this file now. Don't hesitate to re-open if necessary.

Gilles Caulier
Comment 6 elfie.groslin 2016-08-20 14:40:37 UTC
No more artifacts on my end either, this seems fixed.

Thanks.