libraw errors with DNG files processed by Adobe LightRoom

Hi team,
I have a couple of DNG files that were created in Adobe LightRoom. You can find them here:

They fail when calling unpack() with the error "Corrupted data or unexpected EOF". Call to open_file works. Hence raw-identify is able to parse metadata from the file.

I do not have the Adobe DNG APIs as part of my libraw build. Do I need these OR are these files expected to work out of the box with libraw alone?



Trouble adding zlib support on Windows

Hi Alex,
I am having trouble adding ZLIB support on Windows. I believe the Windows build using NMAKE. Not very clear on how to specify the USE_ZLIB and the supporting include and lib paths to nmake on Windows.


Unlike unix systems (Linux,

Unlike unix systems (Linux, macos, etc), there is no standard path to zlib (headers, library), also there is no standard name for the library, it may be called zlib(.lib,.dll) zlib.lib+zlib1.dll, zlib_static.lib, etc.
So, I'm unable to provide specific and precise instructions, only general direction:

Easiest way to re-build libraw under Windows is to call
nmake -f Makefile.msvc
(for example, In Visual Studio command prompt)

So, modify Makefile.msvc to add /DUSE_ZLIB, path to zlib includes in compiler flags, flags to link with zlib to link flags

Alternatively, you may use Visual Studio solution/project provided and add the same to project properties via property settings.

-- Alex Tutubalin


So, you are suggesting I create CFLAGS_ZLIB and LDFLAGS_ZLIB and add them to COPT and LINKLIB lines?

On a related note. Where do I specify USE_X3FTOOLS and USE_6BY9RPI on the Makefile.msvc? Can I update the COPT line to say /DUSE_X3FTOOLS?

Also, I am a little confused on the imported code policy? Do, I need download the sources from the suitable github repo in addition to the libraw source OR is it sufficient to specify the macros enable them as the sources are already present?


> So, you are suggesting I

> So, you are suggesting I create CFLAGS_ZLIB ....

There are multiple ways to change variables in makefile. I think, it is much faster to try and see what happens, than wait for approval....

> On a related note. Where do I specify USE_X3FTOOLS and USE_6BY9RPI

Again: there are multiple ways.The easiest one is to modify COPT=... line

>Do, I need download the sources

No, both X3F_TOOLS and RPI-related code is already in place. It is just not compiled until user explicitly selects it (via specific defines, so /D.... statements in msvc case)

-- Alex Tutubalin


I will give this a shot and get back if I have any trouble.