Thank you so much for the quick reply and the helpful information!
I still shoot uncompressed raw on my old Sony cameras as the compressed raw format isn't lossless. I do convert everything to DNG eventually as the format I'm working with, but I do like to archive the original out-of-camera files, probably out of paranoia. :)
I'll take a look at the fields you've mentioned and see if I can build something on top of that!
Unfortunately, the information you are asking about and in the form you are asking about is not available in the library (in its direct form).
You can query the (function) name of the decoder used by calling LibRaw:get_decoder_info() and create your own table indexed by the decoder name and containing the properties you need.
In practice, there are very few uncompressed formats now: photographers prefer to save space on flash cards and camera manufacturers follow this wish. Such uncompressed files may still present in archives, but it is hard to find an uncompressed file produced by modern camera (even if camera supports it, photographer will, most likely, switch to compressed format).
If you still want to handle uncompressed formats separately: they can be tiled/striped, so you'll need to add own code that interprets this correctly.
For uncompressed/not tiled data, data starts at libraw_internal_data.unpacker_data.data_offset and
data size is libraw_internal_data.unpacker_data.data_size
These fields are protected (in C++ terms), you may need to subclass LibRaw to access these fields.
I'm not a huge fan of my steps (a few of the stages feel like major hacks), so I might re-approach this with your CMake file and diff when I have time in the future. Thanks again for sharing!
We cannot provide support for components from other vendors. For all questions related to dng sdk please contact Adobe support.
As an exception for the rule above: to create Adobe DNG SDK library (shared or static) just create corresponding build target (static or shared library) in your build environment (MS VS, XCode, whatever...) with all Adobe DNG SDK sources excluding source/dng_validate.cpp
This saves on step. I was already fiddling with the imgdata.thumbnail.
I now need to figure out how to decode the JXL data into something my software can use. Looking at the JXL official library at the moment...
You got hit by 'automated maximum adjustment' code implemented in LibRaw's postprocessing many years ago to avoid 'pink clouds' problem: real data range is not present in RAW metadata while real data maximum is lower than format maximum.
To turn the feature off: use
imgdata.params.adjust_maximum_thr = 0;
(corresponding dcraw_emu command line switch: -c 0)
It is hard to discuss something without having files in question on hands.
Probably: your Sony (!) images are shot in Small/Medium (pseudo)RAW mode. This is YCC files (similar to lossless JPEGs), already processed and white balanced in camera.
Thanks for fixing that link. Source files and libraries are fine. However the /bin subfolder, normally containing executables such as dcraw_emu, is empty in LibRaw-0.21.3-macOS.zip aside from the .keep_me file.
So I could just pull the repository into a clean directory and run a fresh compile of libraw from master using your suggested simpler way to compile, which avoids configure before make.
make -f Makefile.dist
The created binary of static libraw.a is now usable and can be linked with no unresolved symbols from both master branch and also version 0.21.
My finding is:
The suggested way to compile the binaries using 'autoreconf --install' and 'configure' messed up the source repository and build pipeline specifically on our macos environment. For some unknown reason this ended up in an unusable binary of the static libraw library that could not be linked due to 'undefined symbols'.
I should add, that autoreconf/configure requires installation of additional tools using homebrew package manager on Mac, namely autoconf, automake and pkg-config, that are not part of the standard Apple development environment XCode. Seems these tools messed up detection of the proper C/C++ make configuration on mac platform which led to incompatibilities linking two different libraries (undefined symbols).
I rolled back to plain Apple XCode C/C++ development tools, and uninstalled autoconf & Co, before I tried a fresh install of libraw. That said, autoreconf/configure is not possible by using XCode only on Mac plaform.
Apologies, but I didn't dig deeper in analysis what exactly fails using autoreconf/configure on mac, thus cannot provide insights what could be improved for libraw to be installed the suggested way on macos Sonoma.
Avoiding the suggested installation to run autoreconf/configure to compile libraw static binary on mac Sonoma platform is the solution in my case.
Hi Alex,
Thank you so much for the quick reply and the helpful information!
I still shoot uncompressed raw on my old Sony cameras as the compressed raw format isn't lossless. I do convert everything to DNG eventually as the format I'm working with, but I do like to archive the original out-of-camera files, probably out of paranoia. :)
I'll take a look at the fields you've mentioned and see if I can build something on top of that!
Cheers,
Marcus
Unfortunately, the information you are asking about and in the form you are asking about is not available in the library (in its direct form).
You can query the (function) name of the decoder used by calling LibRaw:get_decoder_info() and create your own table indexed by the decoder name and containing the properties you need.
In practice, there are very few uncompressed formats now: photographers prefer to save space on flash cards and camera manufacturers follow this wish. Such uncompressed files may still present in archives, but it is hard to find an uncompressed file produced by modern camera (even if camera supports it, photographer will, most likely, switch to compressed format).
If you still want to handle uncompressed formats separately: they can be tiled/striped, so you'll need to add own code that interprets this correctly.
For uncompressed/not tiled data, data starts at libraw_internal_data.unpacker_data.data_offset and
data size is libraw_internal_data.unpacker_data.data_size
These fields are protected (in C++ terms), you may need to subclass LibRaw to access these fields.
No worries Alex, thanks for the reply and thanks joostn for your CMake steps!
I had started on a process from scratch last week after seeing Alex's reply and put up a gist for the macOS side here before I saw joostn's reply: https://gist.github.com/mikamikem/4e826bb9cf5beacd86ba00e42ba0b115#file-...
Linux steps here: https://gist.github.com/mikamikem/6cf1530b2fa7b011eadd46e19ed9aab7#file-...
I'm not a huge fan of my steps (a few of the stages feel like major hacks), so I might re-approach this with your CMake file and diff when I have time in the future. Thanks again for sharing!
Not sure it will be available in the next snapshot, sorry.
Ah yes, the problem is fixed!
Will this be fixed in LibRaw? I guess I'll have to wait for the next public snapshot?
Thanks
Joost
Oh and I'm applying this patch to make it compatible with current jxl library:
I'm building the DNG SDK using cmake and this CMakeLists.txt. This creates a static library, on Windows, Linux and macos.
Could you please check with RawDigger 1.4.10 beta: https://www.rawdigger.com/news/rawdigger-1-4-10-beta
I'm using the latest RawDigger, 1.4.9 Release Build 821 (ARM64).
Here are 2 screenshots from Adobe camera raw, showing identical colors when using 'As Shot':
https://drive.google.com/file/d/1GhtJUCtIGRBP4FbReq2Jdk5vvPpoKy8X/view?u...
https://drive.google.com/file/d/1skhE7-up6nEWymxM9JShH10mO4ucm3ZL/view?u...
What exact RawDigger version you use for your testing (Windows: Menu - Help - About; Mac - Menu - RawDigger - About)
We cannot provide support for components from other vendors. For all questions related to dng sdk please contact Adobe support.
As an exception for the rule above: to create Adobe DNG SDK library (shared or static) just create corresponding build target (static or shared library) in your build environment (MS VS, XCode, whatever...) with all Adobe DNG SDK sources excluding source/dng_validate.cpp
Thanks, Alex!
This saves on step. I was already fiddling with the
imgdata.thumbnail
.I now need to figure out how to decode the JXL data into something my software can use. Looking at the JXL official library at the moment...
We managed to support JPEG-XL and Canon H265 previews in dcraw_make_mem_thumb via this patch/commit: https://github.com/LibRaw/LibRaw/commit/cc118c1c1869e2559dbd0c7639d21915...
Unpacked JPEG XL thumbnail is available via imgdata.thumbnail (and .thumbs_list)
We'll improve dcraw_make_mem_thumb() to handle it too, although this is just another buffer allocation and as-is data copy for JPEG-XL case
That was it: I set adjust_maximum_thr = 0 and now my captures are consistent. Thanks very much!
You got hit by 'automated maximum adjustment' code implemented in LibRaw's postprocessing many years ago to avoid 'pink clouds' problem: real data range is not present in RAW metadata while real data maximum is lower than format maximum.
To turn the feature off: use
imgdata.params.adjust_maximum_thr = 0;
(corresponding dcraw_emu command line switch: -c 0)
Here are your 0018 file processed via:
dcraw_emu -w -T and dcraw_emu -w -c 0 -T respectively
https://www.dropbox.com/scl/fo/8bgts0j5m5aa8007czqkf/AC8-URS3v42QVYOD_wk...
It is hard to discuss something without having files in question on hands.
Probably: your Sony (!) images are shot in Small/Medium (pseudo)RAW mode. This is YCC files (similar to lossless JPEGs), already processed and white balanced in camera.
...didn't get attached. Here it is: https://www.dropbox.com/scl/fi/b1vbngjqyp3837jq0hh8v/LibRaw0.21.3Exposur...
All looks good now, thanks very much!
rebuilded, reuploaded, downloaded to another computer: should work now
Thanks for fixing that link. Source files and libraries are fine. However the /bin subfolder, normally containing executables such as dcraw_emu, is empty in LibRaw-0.21.3-macOS.zip aside from the .keep_me file.
Best Regards,
AJW
It is disclosed on this site 1st page: https://www.libraw.org/#updatepolicy
Thank you for your feedback
Fixed
Glad to hear that our advice to start over from scratch and not use development tools that you don't understand what they do helped you.
Good morning, Alex.
github problems healed overnight.
So I could just pull the repository into a clean directory and run a fresh compile of libraw from master using your suggested simpler way to compile, which avoids configure before make.
The created binary of static libraw.a is now usable and can be linked with no unresolved symbols from both master branch and also version 0.21.
My finding is:
The suggested way to compile the binaries using 'autoreconf --install' and 'configure' messed up the source repository and build pipeline specifically on our macos environment. For some unknown reason this ended up in an unusable binary of the static libraw library that could not be linked due to 'undefined symbols'.
I should add, that autoreconf/configure requires installation of additional tools using homebrew package manager on Mac, namely autoconf, automake and pkg-config, that are not part of the standard Apple development environment XCode. Seems these tools messed up detection of the proper C/C++ make configuration on mac platform which led to incompatibilities linking two different libraries (undefined symbols).
I rolled back to plain Apple XCode C/C++ development tools, and uninstalled autoconf & Co, before I tried a fresh install of libraw. That said, autoreconf/configure is not possible by using XCode only on Mac plaform.
Apologies, but I didn't dig deeper in analysis what exactly fails using autoreconf/configure on mac, thus cannot provide insights what could be improved for libraw to be installed the suggested way on macos Sonoma.
Avoiding the suggested installation to run autoreconf/configure to compile libraw static binary on mac Sonoma platform is the solution in my case.
Thanks again for your help.
Thilo
Pages