jcelaya / hdrmerge

HDR exposure merging
http://jcelaya.github.io/hdrmerge/
Other
363 stars 78 forks source link

(cont. g1408e42 r64) Writing JPEG previews fails #192

Closed LigH-de closed 5 years ago

LigH-de commented 5 years ago

There is a warning at the end of the output of the CLI version when trying to convert a dual capture Fujifilm EXR-DR RAF:

E:\Programme\HDRMerge_master_continuous-64-g1408e42_release_64>hdrmerge-nogui.exe -a --single -b 24 --no-align -v -vv DSCF4758.RAF
Using LibRaw 0.19.3-Release
Number of frames : 2
[  0%] Loading DSCF4758.RAF
DSCF4758.RAF: 2824x2128 (2880x2128+28+0, by Fujifilm S200EXR, 100ISO 1/60sec f3.5 EV:-9.5216
b4b4b4b4 RGBG, sat 16383, black 512, flip 0, wb: 667 336 615 336, cblack: 512 512 512 512
[ 33%] Loading DSCF4758.RAF
DSCF4758.RAF: 2824x2128 (2880x2128+28+0, by Fujifilm S200EXR, 100ISO 1/60sec f3.5 EV:-9.5216
b4b4b4b4 RGBG, sat 16383, black 512, flip 0, wb: 667 336 615 336, cblack: 512 512 512 512
Load files: 0.122552 seconds
[ 66%] Processing stack
Using white level 15712
Compute response functions: 0.181556 seconds
Generate mask: 0.0798672 seconds
[100%] Done loading!
Writing result to E:/Programme/HDRMerge_master_continuous-64-g1408e42_release_64/DSCF4758-4758.dng
Writing E:/Programme/HDRMerge_master_continuous-64-g1408e42_release_64/DSCF4758-4758.dng, 24-bit, 2824x2128
[  0%] Rendering image
Adjusted white balance: 1.98512 1 1.83036 1
Fatten mask (SSE version): 0.0101068 seconds
Blur: 0.141727 seconds
Compose: 0.138151 seconds
[ 33%] Rendering preview
Render preview: 1.44369 seconds
[ 66%] Writing output
Error converting the preview to JPEG: Unsupported image format
Write output: 0.875338 seconds
[100%] Done writing!

The message Unsupported image format makes me wonder if you just omitted a JPEG encoder library.

Apart from that, I wonder if the current state might be a "nightly" release candidate. The last official release for Windows is still v0.5.

ff2000 commented 5 years ago

Looks like a bug: https://github.com/jcelaya/hdrmerge/blob/04127397a9fade98c29957e7812c410c7b0a1e12/src/DngFloatWriter.cpp#L336 https://doc.qt.io/qt-5/qimagewriter.html#supportedImageFormats Should be "JPG" instead of "JPEG". "JPEG" was OK with Qt4: https://doc.qt.io/archives/qt-4.8/qimagewriter.html#supportedImageFormats

LigH-de commented 5 years ago

Hope for a new binary soon.

LigH-de commented 4 years ago

I tried to patch the EXE with a hex editor, turning the first separate appearance of JPEG into JPG{#0} – it did not work as expected.

LigH-de commented 4 years ago

Not fixed in HDRMerge_release-v0.6_continuous-71-gd7d8041_release_64 – please reopen.

I converted the same Fujifilm raw file (DSCF4758.RAF) containing two frames, created by a Finepix S200 EXR in Dynamic Range mode.

HDRMerge_master_continuous-64-g1408e42_release_64\hdrmerge.exe (2019-07-25, does not contain the string “JPG”) => DSCF4758-4758.dng (13056040 bytes, does not contain the string “JFIF”)

HDRMerge_release-v0.6_continuous-71-gd7d8041_release_64\hdrmerge.exe (2020-02-24, contains the string “JPG” once) => DSCF4758-4758.dng (13056040 bytes, does not contain the string “JFIF”)

Both DNG files are almost bit-exact the same (except for a creation timestamp in the header metadata).

ff2000 commented 4 years ago

It's a packaging issue then. Had a look at the zip and the imageformats plugins are missing: from my linux installation: /usr/lib64/qt5/plugins/imageformats/libqjpeg.so For the location in the zip: https://doc.qt.io/qt-5/windows-deployment.html#qt-plugins

(I looked at the nightly build from here: https://keybase.pub/gaaned92/HDRMergeNightlyBuilds/)

LigH-de commented 4 years ago

Success:

I copied the qjpeg.dll from Luminance HDR to a subdirectory imageformats below the HDRMerge installation. It created a DNG file containign a JPEG preview. If you deploy it in new releases, you will use the current version of your Qt 5 installation.

ff2000 commented 4 years ago

Thx for testing and the confirmation.

akidee commented 4 years ago

Tested with v0.5. Consider reopening this issue:

I get this error for all images of my batch. The DNG is valid, but the preview is missing.

hdrmerge -B -g 5 -b 16 -p full -vv -a *_{0..3}.dng

[  0%] Loading IMG_20200811_153234_0.dng
IMG_20200811_153234_0.dng: 4032x3024 (4032x3024+0+0, by samsung SM-G930F, 64ISO 1/3200sec f1.7 EV:-13.8188
e1e1e1e1 RGBG, sat 1023, black 0, flip 0, wb: 1.77778 1 1.43619 0, cblack: 0 0 0 0
[ 25%] Loading IMG_20200811_153234_2.dng
IMG_20200811_153234_2.dng: 4032x3024 (4032x3024+0+0, by samsung SM-G930F, 64ISO 1/50sec f1.7 EV:-7.81878
e1e1e1e1 RGBG, sat 1023, black 0, flip 0, wb: 1.77778 1 1.43619 0, cblack: 0 0 0 0
[ 50%] Loading IMG_20200811_153234_1.dng
IMG_20200811_153234_1.dng: 4032x3024 (4032x3024+0+0, by samsung SM-G930F, 64ISO 1/400sec f1.7 EV:-10.8188
e1e1e1e1 RGBG, sat 1023, black 0, flip 0, wb: 1.77778 1 1.43619 0, cblack: 0 0 0 0
Load files: 0.364607 seconds
[ 75%] Aligning
Image 1 displaced to (4, -2) with error 251619
Image 0 displaced to (4, -8) with error 224756
Align: 0.19597 seconds
Compute response functions: 0.155091 seconds
Generate mask: 0.429508 seconds
[100%] Done loading!
Writing result to /Users/andi/Pictures/eigene/chronologisch/2020/2020-08-11/IMG_20200811_153234_0-2.dng
Writing /Users/andi/Pictures/eigene/chronologisch/2020/2020-08-11/IMG_20200811_153234_0-2.dng, 16-bit, 4028x3016 cropped
[  0%] Rendering image
Adjusted white balance: 1.77778 1 1.43619 1
Fatten mask: 0.216571 seconds
Blur: 1.08811 seconds
Compose: 0.659695 seconds
[ 33%] Rendering preview
Render preview: 3.30597 seconds
[ 66%] Writing output
Error converting the preview to JPEG: Unsupported image format
Write output: 2.66845 seconds
[100%] Done writing!
LigH-de commented 4 years ago

It was solved in a nightly build. Stable version 0.5 is "ancient".