I *think* that this is about right .

             //

             // Attempt to read the CFA from the root dir

             //

             uint16_t cfarepeatpatterndim[2]{ 0 };

             if (TIFFGetField(m_tiff, TIFFTAG_CFAREPEATPATTERNDIM,
&cfarepeatpatterndim))

             {

                    uint16_t

                           x{ (cfarepeatpatterndim[0]) },

                           y{ (cfarepeatpatterndim[1]) };

 

                           uint8_t* cfapattern =
static_cast<uint8_t*>(alloca(x * y));

                           TIFFGetField(m_tiff, TIFFTAG_CFAPATTERN,
&cfapattern);

             }

 

From: David C. Partridge <[email protected]> 
Sent: 08 April 2023 14:14
To: 'Sulau' <[email protected]>
Cc: '[email protected]' <[email protected]>
Subject: RE: [Tiff] TIFF/EP

 

Well, I was wrong - I think that I *will help enormously* to see some good
sample code to read these tags correctly in the general case.

 

Thanks

David

 

From: David C. Partridge <[email protected]
<mailto:[email protected]> > 
Sent: 07 April 2023 17:49
To: 'Sulau' <[email protected] <mailto:[email protected]> >
Cc: '[email protected]' <[email protected]
<mailto:[email protected]> >
Subject: RE: [Tiff] TIFF/EP

 

Thank you I think I am OK now.  

 

From: Sulau <[email protected] <mailto:[email protected]> > 
Sent: 07 April 2023 13:57
To: 'David C. Partridge' <[email protected]>
Cc: [email protected] <mailto:[email protected]> 
Subject: RE: [Tiff] TIFF/EP

 

Hi David,

 

You can find information /specification about the tags at:

               for EXIF:
https://www.cipa.jp/std/documents/download_e.html?DC-008-Translation-2019-E

               for TIFF/EP:         TIFF/EP Specification: Photography -
Electronic still picture imaging - Removable memory - Part 2: Image data
format - TIFF/EP

                                            (look for TAG2000-22 DIS 12234-2
and see at https://en.wikipedia.org/wiki/TIFF/EP )

               for DNG:              Digital Negative (DNG) Specification
Version 1.6.0.0  from Adobe  at
https://helpx.adobe.com/camera-raw/digital-negative.html 

 

Do you still need a sample code for reading/writing those tags with LibTiff?

 

Regards

Su

 

Von: David C. Partridge [mailto:[email protected]] 
Gesendet: Freitag, 7. April 2023 03:30
An: 'Sulau' <[email protected] <mailto:[email protected]> >
Cc: [email protected] <mailto:[email protected]> 
Betreff: RE: [Tiff] TIFF/EP

 

I found some information after a lot of googling!  I now have some sample
data that makes sense. 

Quick summary: Using data from the definition to the A302 TIFF Tag:

The value consists of:

 

- Two short, being the grid width and height of the repeated pattern.

- Next, for every pixel in that pattern, an identification code.

 

This identification code can be:

 

0 = Red

1 = Green

2 = Blue

3 = Cyan

4 = Magenta

5 = Yellow

6 = White 

 

and now looking at some data extracted from some TIFF files:

TIFF Tag(33421) 0x828d Type(3) ushort(2) ISO CFARepeatPattern: 2 2 

TIFF Tag(33422) 0x828e Type(1) ubyte(4) ISO CFAPattern: 0x00010102

EXIF Tag(41730) 0xa302 Type(7) undef(8) CFAPattern: 0x0002000200010102

It all begins to make sense.

 

Thanks

David

 

From: Sulau <[email protected] <mailto:[email protected]> > 
Sent: 06 April 2023 22:24
To: 'David C. Partridge' <[email protected]
<mailto:[email protected]> >
Cc: [email protected] <mailto:[email protected]> 
Subject: RE: [Tiff] TIFF/EP

 

I see. I can try to compile some easy understandable sample code for you to
explain how to write and read those tags using LibTiff.

But I have to take a closer look at the tags myself first. Maybe after
Easter.

I cannot say anything about their "interpretation" (i.e. meaning).  

 

Von: David C. Partridge [mailto:[email protected]] 
Gesendet: Donnerstag, 6. April 2023 21:36
An: [email protected] <mailto:[email protected]> 
Cc: 'Sulau' <[email protected] <mailto:[email protected]> >
Betreff: RE: [Tiff] TIFF/EP

 

A302 is an EXIF tag with the same name as 828E (CFAPattern).   I know all
three are defined in the source code (grep for CFA).

My concern is sample code to guide me to interpret them correctly.

 

Thanks

David

 

From: Sulau <[email protected] <mailto:[email protected]> > 
Sent: 06 April 2023 19:58
To: 'David C. Partridge' <[email protected]
<mailto:[email protected]> >
Cc: [email protected] <mailto:[email protected]> 
Subject: RE: [Tiff] TIFF/EP

 

Dear David,

 

there is an initial merge request (see
https://gitlab.com/libtiff/libtiff/-/merge_requests/337).

However, there are some issues at this stage. I was preparing an improvement
at the time. I could update it and then upload it to my repository. From
there you could get it and try it. Would that help?

 

CFARepeatPatternDim (828D) and CFAPattern (828E) are define, but what is the
tag-definition of A302?

 

Regards,

Su

 

Von: Tiff [mailto:[email protected]] Im Auftrag von David C.
Partridge
Gesendet: Donnerstag, 6. April 2023 14:39
An: [email protected] <mailto:[email protected]> 
Betreff: [Tiff] TIFF/EP

 

Is there any support in 4.5.0 for TIFF/EP?

Does anyone know of any sample code that reads/processes/writes (e.g.)
CFARepeatPatternDim (828E) and CFAPattern (828E or possible A302).

 

Thanks

David 

 

_______________________________________________
Tiff mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/tiff

Reply via email to