Recent comments

Reply to: What is the format of GPS Data?   10 years 2 months ago

In that case, I presume that the unsigned[32] holds the [tag ID]-[type]-[length]-[data]. Am I right?

Thank you :-)

Reply to: What is the format of GPS Data?   10 years 2 months ago

GPS data is not parsed by LibRaw in any way. It just stored and copied into output image.

GPS block is described in Exiftool docs: http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/GPS.html

Reply to: Inconsistent color results   10 years 2 months ago

The binary libraw.dll is compiled using nmake -f Makefile.msvc (this Makefile is also included into distribution) using
MSVC 2010 with current patches/serivice packs.

You may easily recompile this DLL with compiler flags you want to use

Reply to: Inconsistent color results   10 years 2 months ago

I use the pre-compiled DLL and I have settled with calling FNINIT right before I call the procedure with LibRaw code and it works perfectly.

I guess the compiler made some assumptions (that it shouldn't have?) and the generated code is probably MMX because that and FPU do no mix well without clearing flags in between.

Not too many people will experience this problem as assembly is falling out of use so I don't know if and where this should be documented in LibRaw or if VS2010 can be told to optimize for SSE (it does not have this incompatibility) instead for MMX which I suspect is the case.

Reply to: Inconsistent color results   10 years 2 months ago

There is no ASM/intrinsinc code in LibRaw. Just pure C++.
The problem may relate to different MMX/SSE conventions (compiler settings) in your app and in LibRaw.
Do you recompile LibRaw or use pre-compiled DLLs from this site?

Reply to: Inconsistent color results   10 years 2 months ago

Hey Alex, I have found the problem!

As you are familiar with DCRAW and changes you've made, does it use any MMX or FPU asm code?

In my code I use FPU which is correctly initialized using the FNINIT instruction. I have found it that if I write
FNINIT or EMMS at the end of my FPU block the problem goes away and LibRaw functions as intended.

This is why I suspect some LibRaw or more likely dcraw block is not initialized with FNINIT for FPU or EMMS for MMX.

I have noticed this because the first time I use LibRaw everything works fine but the second time I try to load an image that is when everything goes green or red. Then I started commenting out code suspecting of some memory corruption until I got to FPU.

Reply to: Inconsistent color results   10 years 2 months ago

Do you use same compiler settings (esp. structure fields alignment) in LibRaw compilation and your app compilation.
If structures are aligned differently, you may think you use params.half_size, but really change other structure field.

Try to use default settings (i.e. no raw.imgdata.params.... assignment).

I've tried both your samples without any problem (using dcraw_emu LibRaw sample with -mem switch to use open_buffer() interface)

Reply to: Inconsistent color results   10 years 2 months ago

Hi Alex,

Initially I thought the false color is my wrong and that is why I have put in the dcraw_ppm_tiff_writer("test.ppm") line in the code and the output is corrupted.

I am now trying the C interface and MingW. I will soon know if the problem persists.

P.S. Please consider exposing copy_mem_image() in C API, it will save a lot of memory copying from one buffer to another.

Reply to: Inconsistent color results   10 years 2 months ago

Could you please specify, where you get incorrect colors: in .ppm-file written by LibRaw or in your Bitmap?

Reply to: Does LibRAW take care of image rotation?   10 years 2 months ago

I discovered that the line imgD.params.user_flip = 0; was an unnecessary line. Things worked after removing it from my code.

Also I forgot to include

LibRaw RawProcessor;

and

#define imgD RawProcessor.imgdata

in the original code.

Reply to: How do I correct white balance?   10 years 3 months ago

I later discovered that my problem was due to colour space. I got more vibrant colors once I specified the color space to sRGB (My camera is set to sRGB) - This matched the colours reproduced from LightRoom / Photoshop.

And another thing was that my pointers were incorrect. imgD.params.use_camera_wb=1; was not finding it's way back into the LibRaw RawProcessor structure.

Thank you :-)

Bharath

Reply to: How do I correct white balance?   10 years 3 months ago

use_camera_wb uses camera White Balance ('As Shot').

If you need to specify your own white balance, use user_mul[] coeffs

P.S. All user comment/posts are published only after approval due to heavy comment spam

Reply to: A better Rawnalyze   10 years 3 months ago

Comment update: use our RawDigger application (shareware)

Sure, raw analyzing application is already planned.

Due to vacation schedule, it is unrealistic to expect such application before August.

Reply to: Problem using Libraw about iso_speed   10 years 3 months ago

Oh, you react really fast. Very much thanks.

So, can I get the right iso values from LibRaw?

I don't have a dropbox account, I upload 2 files to baidu and the link is below.

http://pan.baidu.com/share/link?shareid=1813243432&uk=1865652979

These 2 files are taken by Nikon D7100 @iso12800 and iso25600. Hope they are helpful.

Reply to: Problem using Libraw about iso_speed   10 years 3 months ago

Nikon's HIGH-ISOs are specified not in 'common EXIF' tag (tag id=2), but in special tag (tag id = 37).
LibRaw 0.16-beta1 already contains this change, so it should work fine).

Could you please upload sample file to somewhere (Dropbox or so)?

Reply to: Problem using Libraw about iso_speed   10 years 3 months ago
?

?

Reply to: compile libraw with visual studio express   10 years 3 months ago

Use nmake -f Makefile.msvc

Reply to: Problem compiling on Mac OS X   10 years 4 months ago

According to gcc 4.1 manual, __sync_add_and fetch is builtin for this version, so it should works on 4.2 too.

I have not old Xcode on hands, only Xcode4/Xcode5 (llvm based), but this code compiles and links fine on my FreeBSD with gcc 4.2.1 (in both 32-bit and 64-bit mode):

int main()
{
 
 int _exitflag=0;
 if( __sync_add_and_fetch(&_exitflag,0))
        return 1;
 return 0;
}

May be, you need to specify processor target (-march=core2duo because OS X requires at least core2duo)

Reply to: Accessing Raw Bayer data   10 years 4 months ago

Yes, in Canon data these pixels used for black level calibration.
On other cameras (e.g. Nikons) these pixels may be used for banding noise elimination

Reply to: Accessing Raw Bayer data   10 years 4 months ago

Thanks Alex. I see the correct pixel values now!

I was not aware of these masked pixels ... are they provided for black-level calibration?

Thanks,
HEMANTH

Reply to: Accessing Raw Bayer data   10 years 4 months ago

1) The max possible 16-bit value is 65535
2) Many cameras, including Canons, contains 'masked pixels' around visible area. So, for first 100 values you query these service pixels.
Try this code:

#define R RawProcessor
int first_visible_pixel = R.imgdata.sizes.raw_width*R.imgdata_sizes.top_margin + R.imgdata.sizes.left_margin;
for(i=0; i< 100; i++)
  printf("%d ", R.imgdata.rawdata.raw_image(i+first_visible_pixel);

3) After raw2image the image[][] array contains values (only visible area!) for one component out of 4, three other pixel components are zero.

Reply to: linking libraw in Linux   10 years 5 months ago

It works now, thanks.

Reply to: linking libraw in Linux   10 years 5 months ago

Place libraries *after* your sources in linker command line:

g++ main.cpp -o readraw -lraw -lm
Reply to: LibRaw::open_file hang   10 years 5 months ago

Please drop a note if setting second open_file() parameter to 0 helps.
This means, that C++ I/O library on your platform is broken, while C FILE* I/O routines works fine.

Reply to: LibRaw::open_file hang   10 years 5 months ago

I figured as much. Since I haven't been able to recreate it on any devices here I was hoping there might be a logical source that I didn't know about.

Since the issue seems to be that opening is hanging I doubt it will help, but I'll create a new build set to force FILE* input for the user to run.

Pages