Multiple RAW files with dcraw don't work

Bug #2049641 reported by Detlef Paschke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hugin
Fix Committed
Undecided
Unassigned

Bug Description

Hello,

I've had good results with JPEG files using Hugin and wanted to try RAW files.
Since it is sufficient and you don't need any major software, I wanted to use dcraw. But I have a problem when I select several files at once as recommended.
The first file is processed and then the import stops. If I interpret it correctly, there is probably a problem with the white-balance reference where, I think, not all the data is passed to the next pass.

Prozessiere: C:\Program Files\Hugin\bin\dcraw.exe -w -v -4 -T "D:\test\test\IMG_0005.CR2"
Loading Canon EOS 1300D image from D:\test\test\IMG_0005.CR2 ...
Scaling with darkness 2048, saturation 13584, and
multipliers 2.089844 1.000000 1.419922 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to D:\test\test\IMG_0005.tiff ...
Aktualisiere EXIF-Daten der Datei D:\test\test\IMG_0005.tiff
    1 image files updated

Vorgang dauerte 3 s
Prozessiere: C:\Program Files\Hugin\bin\dcraw.exe -r 2.089844 1.000000 -v -4 -T "D:\test\test\IMG_0006.CR2"
Non-numeric argument to "-r"

Vorgang dauerte 0 s

From here nothing happens anymore. You can only cancel the import.
If you import one file at a time, as is not recommended, there are no problems.

Best regards
Detlef Paschke

Revision history for this message
tmodes (tmodes) wrote :

I tested with my RAW files and it works here.
There must be something with your RAW files Hugins is not reading correctly.
Can you provide a link to 2-3 RAW files for further debugging?

Changed in hugin:
status: New → Incomplete
Revision history for this message
Detlef Paschke (schabau) wrote :

Good day,
I have stored an archive with two RAW files from my EOS 1300D on my web server. I hope this helps you.

https://schabau.eu/eos-1300d_raw.7z

I got this output from Hugin when reading the files.

Prozessiere: C:\Program Files\Hugin\bin\dcraw.exe -w -v -4 -T "D:\test\IMG_0001.CR2"
Loading Canon EOS 1300D image from D:\test\IMG_0001.CR2 ...
Scaling with darkness 2048, saturation 13584, and
multipliers 1.832031 1.000000 1.646484 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to D:\test\IMG_0001.tiff ...
Aktualisiere EXIF-Daten der Datei D:\test\IMG_0001.tiff
    1 image files updated

Vorgang dauerte 4 s
Prozessiere: C:\Program Files\Hugin\bin\dcraw.exe -r 1.832031 1.000000 -v -4 -T "D:\test\IMG_0002.CR2"
Non-numeric argument to "-r"

Vorgang dauerte 0 s

Best regards
Detlef Paschke

Revision history for this message
tmodes (tmodes) wrote :

Thanks for the test files.
But I can't reproduce the issue. When using your file, dcraw processes both files without problems:

Prozessiere: C:\Users\Thomas\Downloads\dcraw.exe -w -v -4 -T "C:\daten\Hugin\test\raw\Canon\IMG_0001.CR2"
Loading Canon EOS 1300D image from C:\daten\Hugin\test\raw\Canon\IMG_0001.CR2 ...
Scaling with darkness 2048, saturation 13584, and
multipliers 1.832031 1.000000 1.646484 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to C:\daten\Hugin\test\raw\Canon\IMG_0001.tiff ...
Aktualisiere EXIF-Daten der Datei C:\daten\Hugin\test\raw\Canon\IMG_0001.tiff
    1 image files updated

Vorgang dauerte 5 s
Prozessiere: C:\Users\Thomas\Downloads\dcraw.exe -r 1.832031 1.000000 1.646484 1.000000 -v -4 -T "C:\daten\Hugin\test\raw\Canon\IMG_0002.CR2"
Loading Canon EOS 1300D image from C:\daten\Hugin\test\raw\Canon\IMG_0002.CR2 ...
Scaling with darkness 2048, saturation 13584, and
multipliers 1.832031 1.000000 1.646484 1.000000
AHD interpolation...
Converting to sRGB colorspace...
Writing data to C:\daten\Hugin\test\raw\Canon\IMG_0002.tiff ...
Aktualisiere EXIF-Daten der Datei C:\daten\Hugin\test\raw\Canon\IMG_0002.tiff
    1 image files updated

Vorgang dauerte 4 s

The log of dcraw looks identical to your run. So I don't understand why in your case the wb multiplier are not correctly read from the log. In the log they appear correct, but they are not correctly parsed for the second run of dcraw.

Maybe your dcraw version adds some non-printable to the log? Could you try another dcraw version?

Just to be sure: you are using the latest Hugin version 2023.0?

Revision history for this message
Detlef Paschke (schabau) wrote :

Hello,
I think I use the current versions of Hugin and dcraw.

Best regards
Detlef Paschke

dcraw:
C:\Users\root>"C:\Program Files\Hugin\bin\dcraw.exe"

Raw photo decoder "dcraw" v9.28
by Dave Coffin, dcoffin a cybercom o net

Usage: C:\Program Files\Hugin\bin\dcraw.exe [OPTION]... [FILE]...

Hugin:
Betriebssystem: Windows 11 (build 22631), 64-bit edition
Architektur: 64 bit
Freier Speicher: 11213876 kiB
Aktive Codepage: 1252 (Western European Windows)

Hugin
Version: 2023.0.0.d88dc56ded0e built by Thomas
Ressourcen-Pfad: C:\Program Files\Hugin\share\hugin\xrc\
Datenpfad: C:\Program Files\Hugin\share\hugin\data\
Hugins Kamera- und Objektivdatenbank: C:\Users\root\AppData\Roaming\hugin\camlens.db
Multi-Threading mittels C++11 std::thread und OpenMP
Monitorprofile: C:\Windows\system32\spool\drivers\color\sRGB Color Space Profile.icm

Bibliotheken
wxWidgets: wxWidgets 3.3
wxWidgets Library (wxMSW port)
Version 3.3.0 (Unicode: wchar_t, debug level: 1),
compiled at Jun 16 2023 18:57:03

Runtime version of toolkit used is 10.0.

libpano13: 2.9.22
Exiv2: 0.27.6
SQLite3: 3.42.0
Vigra: 1.11.1
LittleCMS2: 2.14

Revision history for this message
Detlef Paschke (schabau) wrote :

Which version of dcraw did you use?

Revision history for this message
tmodes (tmodes) wrote :

I tested with 3 different dcraw executables. All are version 9.28:

Raw photo decoder "dcraw" v9.28
by Dave Coffin, dcoffin a cybercom o net

Usage: dcraw.exe [OPTION]... [FILE]...

Revision history for this message
tmodes (tmodes) wrote :

One idea to test. Redirect the output of the first dcraw command to a log file and attach the log file here.

From your log the command should be:
C:\Program Files\Hugin\bin\dcraw.exe -w -v -4 -T "D:\test\IMG_0001.CR2" 2>IMG_0001.log

(and yes, it should be 2>IMG_0001.log)

Revision history for this message
Detlef Paschke (schabau) wrote :

I did it, attached the IMG_0001.log from this command:

"C:\Program Files\Hugin\bin\dcraw.exe" -w -v -4 -T "D:\test\IMG_0001.CR2" 2>IMG_0001.log

Revision history for this message
Detlef Paschke (schabau) wrote :

I have now started Hugin again and set the settings to default to be on the safe side. Then selected two RAW files and created the attached IMG_0001_hugin.log.
The only thing I noticed in the log was that when I opened the first file with dcraw, there were two spaces between dcraw.exe and -w and in the second file, there were two spaces between 1.000000 and -v.

Revision history for this message
tmodes (tmodes) wrote :

The log file looks the same on my machine.

When processing the first file dcraw prints the used wb multiplier:
multipliers 1.832031 1.000000 1.646484 1.000000

These are parsed by hugin and passed to the second call of dcraw.
This works on my side:
Prozessiere: C:\Users\Thomas\Downloads\dcraw.exe -r 1.832031 1.000000 1.646484 1.000000 -v -4 -T "C:\date

But on your side the last 2 numbers are missing:
Prozessiere: C:\Program Files\Hugin\bin\dcraw.exe -r 1.832031 1.000000 -v -4 -T "D:\test\IMG_0002.CR2"

So my assumptions was that there were some hidden characters (ASCII <32), which confuses the parsing. But the log looks normal without hidden characters.

(The parsing is very simple: all characters behind the word multipliers up to the line end are used to construct the second dcraw call.)

Sorry, but currently I have no further idea what to check.

Changed in hugin:
status: Incomplete → New
Revision history for this message
Detlef Paschke (schabau) wrote :

I'm a bit at a loss too.
It worked without any problems with darktable, but it is a large package and the darktable cli is probably not available separately.
Dcraw is wonderfully small, one file and it does what I need. No more and no less. But why the two values of dcraw.exe -r disappeared is inexplicable. Windows 11???

Revision history for this message
tmodes (tmodes) wrote :

I upload a test version of Hugin with more debug output: https://sourceforge.net/projects/hugin/files/hugin/hugin-2024.0/Hugin_test_win.zip/download
Please extract into a separate folder. Do not overwrite an existing installation.
It contains only a subset of all files and it may hang after conversion.
Please try to import your raw files. It will print some more debug information.
Select details and then copy all the information it has printed.
Maybe it delivers a hint what exactly goes wrong.

Revision history for this message
Detlef Paschke (schabau) wrote :

Hello,

Here is the hugin_debug.log from an attempt with dcraw.

Best regards
Detlef Paschke

Revision history for this message
tmodes (tmodes) wrote :

That helps to fix it. The log shows that the line were wrapped at the width of the control. When I decreased the width of the log window I was able to reproduce the bug. I fixed this in the repository. It will be in the next version.

A workaround for the time being is the increase the width of the log window when dcraw runs. (This setting is stored so it needs to be done only once.)

Changed in hugin:
milestone: none → 2024.0beta1
status: New → Fix Committed
Revision history for this message
Detlef Paschke (schabau) wrote :

Hello,

I made the log window a little wider and it now works as it should.
Thank you for looking and finding the error.

Best regards
Detlef Paschke

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.