Recent comments

Reply to: Error occurs while using libraw.dll in VS 2010   11 years 8 months ago

I solved the problem by creating another new project in VS2010 and copy everything to the new project. I don't know why this can solve the problem though. Btw, examples work well. :)

Reply to: Error occurs while using libraw.dll in VS 2010   11 years 8 months ago

Are the LibRaw examples works OK?

Reply to: Exposure corrections problem   11 years 8 months ago

You also need to turn off auto brightness. If not, values will be scaled to fill full data range.

Reply to: Copy memory buffer to BitmapData   11 years 9 months ago

It may be caused by read-only memory in .Net Bitmap object (I know nothing about Bitmap type).

After you've called dcraw_make_mem_image, the RGB pixels are contained in image->data. You may try to create Bitmap directly from this array without extra copy_mem_image() call.

Reply to: Copy memory buffer to BitmapData   11 years 9 months ago

Thanks for your quick reply, but even though I changed the 'step' to image->width*3, it still gives me an error at the line of copy_mem_image(&bmpPtr, step, 0). The error is: Unhandled exception at 0x77ea15de in Raw_Tool.exe: 0xC0000005: Access violation. Could you tell me why?

Reply to: Copy memory buffer to BitmapData   11 years 9 months ago

Should the 'step', which is also called stride for bitmap, has to be a multiple of 4?? If width*3 is not multiple of 4, would it gives an error when creating an bitmap object??

Reply to: Copy memory buffer to BitmapData   11 years 9 months ago

copy_mem_image() copies image data without alpha channel (4th byte).

If you need alpha channel in your bitmap, you need to use per-pixel copy in a loop.

Reply to: Copy memory buffer to BitmapData   11 years 9 months ago

Your 'step' calculation is wrong. copy_mem_image accept step in bytes, for 8-bit images it is width*3.
You calculate step as width*(24/8)*3 so width*9.

Reply to: Recycle Error   11 years 9 months ago

Could you please provide more info (stack trace of crash, or test program to reproduce or so)?

Reply to: problems with Nikon Coolscan 4000 .nef file   11 years 9 months ago

Thanks again for your time. I found the camera list ;-)

Reply to: problems with Nikon Coolscan 4000 .nef file   11 years 9 months ago

Thanks for file. Downloaded it, you may remove the file from Dropbox.

The list of supported cameras is updated very frequently, so no list on website. There is API call LibRaw::cameraList().

Reply to: problems with Nikon Coolscan 4000 .nef file   11 years 9 months ago

Thank for your answer!

Is there a page where i can see all supported cameras? Maybe i just didn't find it so far...

If you like have a look at it you should find an example .nef file (coolscan4000.zip) within the next minutes at my Dropbox:
https://www.dropbox.com/sh/oxj1kd92vb62igf/EAFfqdqQ0c/Bilder

Thanks again!

Reply to: Possible bug: Temporary files left on filesystem after decoding an .SRW file (0.14.4)   11 years 9 months ago

Sorry, no 0.14.4 on hand (this is more-than-one-year version).

I've made a quick check: downloaded LibRaw 0.14.7 Win32 binary from http://www.libraw.org/download#stable
and use dcraw_emu.exe for decoding Samsung NX-100 SRW file.

No additional files appear, only expected .tiff or .ppm one.

Reply to: Possible bug: Temporary files left on filesystem after decoding an .SRW file (0.14.4)   11 years 9 months ago

In this case, I'm using Shotwell 0.13.1+trunk, and we're using LibRaw version 0.14.4.

Reply to: problems with Nikon Coolscan 4000 .nef file   11 years 9 months ago

Coolscan 4000 is not in the list of supported cameras :)

Generally, files from Scanners should be 3-component, not bayer-pattern. So, camera-targeted NEF-handling code will not work with scanner files because only one per-pixel component is expected.

BTW, if you provide any sample of Coolscan .NEF output, it will be analyzed in depth. May be, it is easy to add support for these files to LibRaw

Reply to: Possible bug: Temporary files left on filesystem after decoding an .SRW file (0.14.4)   11 years 9 months ago

Could you please provide more details about your working environment:
- what application do you use for decode files?
- what LibRaw version do you use?

Reply to: Instant Display   11 years 9 months ago

I'm not OpenCV specialist, so I cannot help with OpenCV/System.drawing errors.

Reply to: Instant Display   11 years 9 months ago

I finally can display the image using LibRaw together with OpenCV. However, I found that it is okay to display .CR2 files of 5D Mark III but .CR2 files of 5D Mark II. It gives a error:
"An unhandled exception of type 'System.ArgumentException' occurred in System.Drawing.dll
Additional information: Parameter is not valid."
Is there any difference between the .CR2 files of 5D Mark II and Mark III?

My code is:

int check = Processor1->dcraw_process();
//process the image into memory buffer
libraw_processed_image_t *image = Processor1->dcraw_make_mem_image(&check);

//create a Mat object by data obtained from LibRaw
cv::Mat cvImage(cv::Size(image->width, image->height), CV_8UC3, image->data, cv::Mat::AUTO_STEP);

cv::cvtColor(cvImage, cvImage, CV_RGB2BGR); //Convert RGB to BGR

IntPtr ptr(cvImage.ptr()); //create a pointer based on the Mat object image

//Error occurs in the following statement, the last line with 'ptr'
Bitmap^ b = gcnew Bitmap(cvImage.cols,
cvImage.rows,
cvImage.step,
PixelFormat::Format24bppRgb,
ptr); //bitmap object of the image

Reply to: How to make LibRaw objects global?   11 years 10 months ago

You may use
LibRaw* processor1;
and than use
processor1= new LibRaw;
in the constructor of your object

Reply to: dcraw_make_mem_thumb   11 years 10 months ago

dcraw produces *file*, not in-memory object.
Dcraw file output is emulated in dcraw_emu sample

Reply to: dcraw_make_mem_thumb   11 years 10 months ago

OK, I see, so that aspect of dcraw output is not emulated and that's intentional?

Reply to: dcraw_make_mem_thumb   11 years 10 months ago

The PPM header is added by dcraw on file write.

Reply to: dcraw_make_mem_thumb   11 years 10 months ago

I'm trying to open phase one images which have PPM thumbnails. When I extract the thumbnail with dcraw I get PPM. When I use libraw I seem to get just the RGB data, without the PPM header. Am I doing something wrong or is it getting stripped?

Reply to: Instant Display   11 years 10 months ago

LibRaw does not contain any drawing code. You need to implement it yourself.

Histograms are calculated for auto-brightness code, but these histograms are not intended to use in external application:
- histograms calculated before white balance and brightness applied
- the actual pixel value is divided by 8 to make histograms compact.

Reply to: RAW data processing   11 years 10 months ago

Yes, you may simple pack linear 16-bit data (bayer pattern or after demosaic) into DNG

Pages