Hi!
Should the orientation and other data in imgdata.sizes be ready after opening the raw file and before unpack/raw2image_ex? I have issue with imgdata.sizes.flip property for 10D. It is has value 270 before raw2image_ex and a correct bit-wise value after raw2image_ex.
LibRaw 0.17
Thanks!
imgdata.image (and rawdata.*)
imgdata.image (and rawdata.*) and imgdata.sizes are always in 'sensor dimensions', so it is alwasy unrotated and rotation/mirroring is read/set via flip/user_flip.
Rotation/mirroring is performed on output phase:
dcraw_ppm_tiff_writer()
or
dcraw_make_mem_image()
-- Alex Tutubalin @LibRaw LLC
Also, flip is 'bit-field', it
Also, flip is 'bit-field', it converted from degree rotation to bits in raw2image_start() if not corrected before
-- Alex Tutubalin @LibRaw LLC
For most camera which I have
For most camera which I have used the flip field means "bit-field" before actually processing (unpack()/raw2image_start()). But for EOS 10D this flag means the rotation angle. So, I would prefer not to start processing but get meaning of this field: is it bit-field or angle. Is it possible to know if it was corrected before?
From first lines of raw2image
From first lines of raw2image_start (called by _ex):
So:
flip/user_filp are bit-field. But if someone has specified user_flip in degrees it will work OK.
Specifically for CIFF (CRW) format camera sets rotation angle, not Orientation tag. This value is preserved after open_datastream (looks like we need to fix it for all cases in 0.18?)
-- Alex Tutubalin @LibRaw LLC
Now I have my fix looks like:
Now I have my fix looks like:
switch (imgdata.sizes.flip)
{
case 3://0011
case 180:
metaData.flip = Meta_data::Flip_180;
break;
case 5://0101
case 270:
metaData.flip = Meta_data::Flip_90CCW;
break;
case 6://0110
case 90:
metaData.flip = Meta_data::Flip_90CW;
break;
And in reverse direction in
And in reverse direction in LibRaw master: https://github.com/LibRaw/LibRaw/commit/f9a69610748abe1a07362696129123eb...
:)
-- Alex Tutubalin @LibRaw LLC