Hi.
Thanks for LibRaw; it's a very convenient way to process raw images. However, I've run into a problem.
I'm using half_size = 1 to get small images without color interpolation fast,
and dcraw_make_mem_image() to get a copy in memory.
If I run this several times on the same image, the first image is different from the following images.
I've added a small test program, and sample images.
regards,
koen
Attachment | Size |
---|---|
dcraw.txt | 3.21 KB |
first_image.jpg | 21.67 KB |
next_images.jpg | 26.2 KB |
Source of test program:
Any idiot can face a crisis - it's day to day living that wears you out.
Anton Chekov
Thanks for bug report. It
Thanks for bug report.
It looks very strange for me because I use half_mode in my programs without any problem, but I'll test your code sample.
What version of LibRaw do you use?
-- Alex Tutubalin @LibRaw LLC
I'm using LibRaw 0.13.1. I've
I'm using LibRaw 0.13.1. I've tested on Windows and macosx; and in each case there is a difference between the first and the second decoded image.
Any idiot can face a crisis - it's day to day living that wears you out.
Anton Chekov
The case is confirmed, your
The case is confirmed, your code really produces different first image (have not looked into it, but see by different MD5 sums).
Thanks again for your bug report. I'll write another comment here when bug will be fixed
-- Alex Tutubalin @LibRaw LLC
Solved!
The problem is very simple:
- you have set half_size=1 *after* unpack is called. So for the very first run the half_size is not set for unpack stage but set for postprocessing stage.
But half_size option is heavily used on unpack() stage (only 1/4 of image array allocated, pixel data placement is very different).
You need to move
rawProcessor_.imgdata.params.half_size = 1;
line above of unpack() call.
-- Alex Tutubalin @LibRaw LLC
Perfect, thank you!
Perfect, everything works. Thank you!
Any idiot can face a crisis - it's day to day living that wears you out.
Anton Chekov