Read exif issue from panasonic raw file

According to the https://exiftool.org/TagNames/Panasonic.html, the `AFPointPosition` tag id is 0x004d.

But it seems to the PanasonicRaw tags parsing is used in libraw.

Is it possible to access the 0x004d exif data form modern RW2 file without modifying the source code heavily?

Thanks for your great work.

Forums: 

I've tried to use these code

I've tried to use these code to catch the exif tag data.

void exif_cb(void *context, int tag, int type,
			 int len, unsigned int ord, void *ifp,
			 INT64 base)
{
	print(tag);
	if (tag == (0x004d | 0x30000)) {
		print("get the 0x004d tag");
	}
}

0x004d is from https://exiftool.org/TagNames/Panasonic.html named "AFPointPosition".

I can get all the tags printed, but no "0x004d" found.

p.s.
The rw2 raw file i'm using can be extracted a "0x004d" AFPointPosition tag data by the ExifTool downloaded from https://exiftool.org/

I do not know what specific

I do not know what specific camera you're talking about.

Just inspected some GH5S file. For this file 0x004d/AFPointPosition tag is not in IFD0, but in makernotes section of EXIF.

The bad thing: this is NOT RAW/EXIF, but EXIF contained in embedded JPEG preview.

So, to extract the data you need:
- extract thumbnail (preview) using LibRaw::unpack_thumb
- use some EXIF parser to parse thumbnail's EXIF

-- Alex Tutubalin @LibRaw LLC

Great, I didn't know that the

Great, I didn't know that the 0x004d tag is not in Raw exif but in thumbnail exif. Thanks for the advice.

I used the exiftool program

I used the exiftool program to see the structure (with -v3 command line key to see details)
It clearly shows this:

| 32) JpgFromRaw (SubDirectory) -->
| - Tag 0x002e (713278 bytes, undef[713278]):
[skip[
--- DOC1:JpgFromRaw --------------------------------------------------------
JPEG APP1 (50684 bytes):
0006: 45 78 69 66 00 00 49 49 2a 00 08 00 00 00 10 00 [Exif..II*.......]
[skip]
ExifByteOrder = II
+ [IFD0 directory with 16 entries]
and 0x004d is within Makernotes pointed by this (JpgFromRaw) EXIF

-- Alex Tutubalin @LibRaw LLC

Thanks for the tip. I'm

Thanks for the tip. I'm trying to parse and get the data from lr_ptr->imgdata.thumbnail.thumb

Hi, sorry to bother you again

Hi, sorry to bother you again.

  | 9)  ExifOffset (SubDirectory) -->
  |     - Tag 0x8769 (4 bytes, int32u[1]):
  |         008a: ae 02 00 00                                     [....]
  | + [ExifIFD directory with 42 entries]
  | | 0)  ExposureTime = 0.002 (10/5000)
  | |     - Tag 0x829a (8 bytes, rational64u[1]):
  | |         04c4: 0a 00 00 00 88 13 00 00                         [........]

Don't know how the offset works,

0x008a + 4 + 0x02ae does not equal to 0x04c4

1)Not sure what is displayed

1)Not sure what is displayed by exiftool, it may be offset from file beginning, not from jpeg preview start.
(hard to tell without having the file)

2) tags larger than 4 bytes contains offset (relative to IFD start), not exact value, so one need to seek to this offset to read the data. There is not enough output in your quote to check this.

BTW, I suggest you to not invent the wheel :), but use some exif parser (e.g. exiv2 if you can tolerate GPL licensing)

-- Alex Tutubalin @LibRaw LLC