Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing custom metadata tags #40

Open
sergiobellido opened this issue Aug 4, 2022 · 1 comment
Open

Writing custom metadata tags #40

sergiobellido opened this issue Aug 4, 2022 · 1 comment

Comments

@sergiobellido
Copy link

I would like to write custom metadata tags in a .tiff image.

The problem is that the library or exiftool program does not recognize the tags as standard format and they are not written in the metadata parameters at image. It only recognizes the 'Exposure' tag and writes as an XMP tag.
The code I am using to write is:

image = "IMG_1_2.tiff"
message_1 = "-Exposure=300"
message_2 = "-Gain=16"
exiftoolPath = os.environ.get('exiftoolpath') 
with exiftool.ExifTool(exiftoolPath) as et:
    et.execute(message_1.encode('utf8', 'ignore'), image.encode('utf8', 'ignore'))  
    et.execute(message_2.encode('utf8', 'ignore'), image.encode('utf8', 'ignore'))

The code for reading metadata:

image = "IMG_1_2.tiff"
exiftoolPath = os.environ.get('exiftoolpath')
with exiftool.ExifTool(exiftoolPath) as exift:
    metadata = exift.get_metadata(image)

Attached is the image.
Any help would be appreciated.

Thanks.

@sylikc
Copy link

sylikc commented Aug 28, 2022

@sergiobellido this project is currently defunct. My fork is the most active at the moment, and I just added some sample code which will allow adding custom tags.

Take a look at some of the code here to see how to write a custom binary MakerNotes, for example https://github.com/sylikc/pyexiftool/blob/master/tests/test_exiftool_bytes.py

If you need more help, please open an issue over on my fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants