Recent comments

Reply to: Segmentation Fault when processing some raw images   4 years 2 months ago

I am using CentOS and I have built it using the following steps:

-Removed all the libraw files from /usr/local/lib
-Removed all the libraw header files /usr/local/include
-git cloned libraw from github
-cd into LibRaw folder
-autoreconf --install
-./configure
-make
-sudo make install

I have built the sample/simple_dcraw.cpp using the command:
g++ -I/usr/local/include -L/usr/local/lib -lraw -o simple_dcraw simple_dcraw.cpp

Then I just run the command:
./simple_dcraw -v example.CR3 (Where example.CR3 is a raw file)

After which I get:
Processing file example.CR3
Segmentation fault

Anything that I could be missing on here?

-- Siddaharth Suman

Reply to: Segmentation Fault when processing some raw images   4 years 2 months ago

I do not know what build environment you use.
If it is Linux, it may already contain (older) LibRaw

Reply to: Segmentation Fault when processing some raw images   4 years 2 months ago

Hi Alex,

Thanks for your reply.

This is the first time I have built the LibRaw library and I directly built it from the 201910 snapshot. I don't think I have a outdated libraw.so issue.

-- Siddaharth Suman

Reply to: Segmentation Fault when processing some raw images   4 years 2 months ago

Please make sure you do not have outdated libraw.so somewhere in dynamic linker search path

Reply to: Libraw Android Port on GitHub   4 years 2 months ago

Hello,

Is it planned to port more recent version of libraw library to Android?

Thanks

Reply to: Don't want to use LCMS   4 years 3 months ago

Ok, I found the problem. It didn't really involve lcms.
I had removed pkgconfig from /usr/local/lib. However pkgconfig is required for static libraries (specifically libraw_r.a which I was trying to use). I restored pkgconfig and compiled and ran my code.
Thanks for your help.

Reply to: Don't want to use LCMS   4 years 3 months ago

If you use ./configure script to build libraw, use --disable-lcms to disable lcms auto-detection.

Alternatively you can use make -f Makefile.dist, LCMS section is disabled (commented out) by default.

Reply to: Python API   4 years 3 months ago

There are rawpy: https://pypi.org/project/rawpy/
And several other libraries (googled by 'libraw python')

Reply to: unpack_thumb unpacks previews instead   4 years 3 months ago

unpack_thumb() provides largest available thumbnail/preview/whatever-it-called.

Reply to: Cr3 Raw wrong Whitebalance   4 years 3 months ago

Great to hear you've fixed the problem w/ white balance.

Reply to: Cr3 Raw wrong Whitebalance   4 years 3 months ago

Haha oh man, thanks for the answer!

I'm stupid, I just wanted it to be done and didn't look right at my garbage.
I fixed the code and the Whitebalance probleme disapeared.

But unfortunaly I ran into another problem.
The red colors seems to be shifted, so brown colors appears bluish.
Also blue seems to become orange.

Here is the correct image as jpg Converted from Photoshop
http://neuland.wtf/img/correct.jpg
and the source Raw file:
http://neuland.wtf/img/srcraw.CR3

I tried to play with the settings in Rawprocessor->imgdata.params, but couldn't figure it out.
My code looks now something like this (not production code):

int LoadRaw(char *charBuffer, int size)
{
	RawProcessor->open_file(charBuffer);
 
	// Result if enabled : http://neuland.wtf/img/camera_wb.jpeg
	RawProcessor->imgdata.params.use_camera_wb = 0;
 
	// Result if enabled: http://neuland.wtf/img/auto_wb.jpeg
  	RawProcessor->imgdata.params.use_auto_wb = 1;
 
  	RawProcessor->unpack();
  	RawProcessor->dcraw_process();
}
Reply to: Cr3 Raw wrong Whitebalance   4 years 3 months ago

Followup:
in your code sample you make a copy of RawProcessor.imgdata by this line:
libraw_data_t imgD = RawProcessor.imgdata;
Than change your copy, not RawProcessor.imgdata.params

Is this a typo in code sample (you really use reference in your real code)?

Reply to: Cr3 Raw wrong Whitebalance   4 years 3 months ago

It is hard to discuss such kind of problem without having raw file sample on hands.

Reply to: Overwriting/Generating fake Nikon .NEF raw files   4 years 3 months ago

DNG specs are available at Adobe site: https://wwwimages2.adobe.com/content/dam/acom/en/products/photoshop/pdfs...

AFAIK, there is no public specs for NEFs

Reply to: Overwriting/Generating fake Nikon .NEF raw files   4 years 3 months ago

LibRaw is not able to write raw files.

Reply to: Overwriting/Generating fake Nikon .NEF raw files   4 years 3 months ago

Both DNG and NEF are TIFF/EP containers, so the spec you're after is the TIFF/EP spec. On top of that there is custom tags in both formats: the DNG ones are described in its spec (surprised you couldn't find it), the NEF ones you can glimpse maybe from e.g. ExifTool, but I don't think it's published by Nikon. I think you pretty much have to come up with your own writer, or use some TIFF library and extend it.

Reply to: Overwriting/Generating fake Nikon .NEF raw files   4 years 3 months ago

Thank you for your reply!

I thought that at least there should be some specs about the DNG file format. The SDK is great!
This might help me a bit.

But the thing I really need is NEF editing. If anyone has any hints please tell :-)
I found rawpy which uses libraw and reads NEF files. Loads the undemosaiced raw data.
Only thing missing now is a way to overwrite the file.

Reply to: dcraw_make_mem_image - no error reported in low memory situation   4 years 3 months ago

Looks like issue is earlier in the process.
One of the load_stream/unpack/dcraw_process is silently failing to allocate some memory, so when it comes to the dcraw_make_mem_image it is being told that width/height/etc are all 0, hence no error, but no return data.

If I can determine where it is failing I'll pass it on, otherwise - feel free to ignore me for now :)

Reply to: dcraw_make_mem_image - no error reported in low memory situation   4 years 3 months ago

Follow-up:
After looking at how the code fails in my app, it appears that:

this method is returning an object, but the `data_size` property is 0 (zero).
I guess it is possible that the call to dcraw_process also failed.
I'm going to go back to the debugger and ensure valid data is being presented - I will update when I have confirmed one way or the other.

Reply to: Overwriting/Generating fake Nikon .NEF raw files   4 years 3 months ago

LibRaw reads RAW files, but not writes into them.

To create DNG file you may use Adobe DNG SDK

Reply to: Sony IMX sensors in machine vision camera   4 years 3 months ago

If, on top of this, you also need accurate color reproduction, an alternative approach would be to construct a DNG from your raw bytestream, e.g. in 2 steps:
1) see e.g. rawtopgm from netpbm tools, or use ImageMagick/GraphicsMagick raw 'GRAY' format to convert to a widely known and simple PGM
2) use http://a1ex.magiclantern.fm/bleeding-edge/pgm2dng.c (adjust metadata accordingly in the source or using e.g. exiftool afterwards); see also https://github.com/fastvideo/pgm2dng

However, you'd need some (not so trivial) sensor characterization work to be able to fill the DNG metadata (basically build your own DCP). LibRaw would need this information anyway even if you went with the open_bayer() route and want more accurate color reproduction. The upside of the DNG route is that you can use many more processors/libraries in the future.

Reply to: Sony IMX sensors in machine vision camera   4 years 3 months ago

Thanks will have a look!

Reply to: Sony IMX sensors in machine vision camera   4 years 3 months ago

if your image is 'raw dump' (so just bytes from sensor), LibRaw::open_bayer is for you.

It is not well documented, use samples/openbayer_sample.cpp and Changelog.txt as a reference

Reply to: panasonic 14 bits   4 years 4 months ago

Thank you for the info.

Panasonic 14-bit decoder is already included in LibRaw latest 'public snapshot'

Reply to: Qt Windows 64-bit link fails with many errors   4 years 4 months ago

I don’t see what you are doing and therefore it’s hard to help you.

You need to set-up visual studio build environment corresponding to your build architecture. It could be done via several ways:
- vcvars32/vcvars64 on older Microsoft Visual Studio
- vcvarsall.bat x64 or x86 on newer Visual Studio
- visual studio shell

.bat files mentioned are *not* part of LibRaw but provided with Visual Studio.

I do not know what Visial Studio you use ('latest' is NOT version specification), I do not have Community Edition installed (so I do not know how it differ from other versions), etc, etc,etc.

Pages