Main Menu

How to find TAGs

Started by zam5da, August 31, 2024, 09:12:51 AM

Previous topic - Next topic

zam5da

Hello,

I have a question. How can exiftool extract the HDR gain map?
I'm trying to extract HDR gain map using python, but I can't find the exact TAG of HDR gain map.
I guess it would be somewhere in APP2 but too difficult for me to find.

please teach me how to find and extract it.

Phil Harvey

You need to be more specific.  Images?  What format?  From what device?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

There's the XMP-hdrgm group, which is listed as
QuoteTags used in Adobe gain map images

Otherwise, you would use the command in FAQ #3 to see all known tags and duplicated names. If nothing seems to be the right ones after that, you can add the -u (-unknown) option to list the unknown tags. You can go even deeper by using the -v3 (-verbose3) option which will break down each section of the file for you.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

zam5da

Thanks for your reply!!

I'm trying to extract HDR gain map of JPG format of Samsung Galaxy devices using Python, like Exiftool does.
Exiftool excellently does it. (exiftool -b -MPImage2 original.jpg > HDR_gain_map.jpg)

StarGeek

Exiftool's source code is available on Github so you could look through that.

The -v3 is very useful for figuring out the inner details of the file.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

OK.  This gain map is from the MPF trailer.  The MPF specification contains all the details about this format.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

zam5da

The advice from the two of you was very helpful to me. Thank you!!!!

zam5da

Hello,
the world of JPGs is interesting and difficult.
May I ask you something more?

When I use the following command, how does Exiftool get 45569 bytes of MPImageLength and MPImage2 trailer?
Even if I change Item:Length="45569" in XML metadata something else like "55512", it still gets "45569".

exiftool -v3 org2.jpg

ExifToolVersion = 12.94
FileName = org2.jpg
.
.
.
MPImageLength = 45569
  | | - Tag 0x0004 (4 bytes, int32u[1]):
  | |     f999: 01 b2 00 00
.
.
.
MPImage2 trailer (45569 bytes at offset 0x3b4755):



I was trying to figure this out by searching the ExifTool repository on GitHub, but I couldn't find the answer.
(https://github.com/exiftool/exiftool/blob/master/exiftool)

I would really appreciate your reply.
Thanks!

StarGeek

Phil is currently away for the next two weeks and this will require a response from him.

But as he pointed out, the data is in the trailer, so editing the XMP won't change it. It would probably be a bad idea to try and directly edit the tag, as that would change the amount of data read, which probably would corrupt the results. Reading the specs linked is probably what you need to do.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

As StarGeek says, you should read the MPF specification if you want to understand how this information is stored.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).