Announcement

  •  » Extensions
  •  » Extracting custom metadata from PNG file

#1 2023-11-18 17:53:07

mundiplaga
Member
2023-11-18
1

Extracting custom metadata from PNG file

Hello,

I have some PNG photos generated with comfyUI/StableDiffusion that have some custom metadata fields embedded like the "prompt" that was used to generate the photo.

I have tried the extensions "Manage Properties Photos" and "AlwaysShowMetadata" but these appear to only work for EXIF and IPTC metadata, and I'm assuming this PNG metadata I'm looking for do not conform to these specifications.

Does anyone have any tips or tricks I can use to extract a custom metadata field on PNG images? In my example PNGs, when I scan with https://www.metadata2go.com/ I can see the information I'm looking for in a field called "prompt". Ideally I could fork the "Manage Properties Photos" plugin to work with my custom field but I'm a bit lost.

Piwigo 13.8.0 Check for upgrade
Installed on 12 November 2023, 5 days ago
Operating system: Linux
PHP: 7.4.3-4ubuntu2.19 (Show info) [2023-11-18 09:46:26]
MySQL: 8.0.35-0ubuntu0.20.04.1 [2023-11-18 16:46:26]
Graphics Library: GD 2.2.5
Cache size N/A   never calculated Refresh

Offline

 

#2 2023-11-18 19:46:42

erAck
Only trying to help
2015-09-06
2054

Re: Extracting custom metadata from PNG file

If the field shows up with exiftool -s filename.jpg (and exiftool -json filename.jpg as well) you could try [extension by plg] Exiftool Keywords and add the field's name to the local config, like

$conf['ek_fields'] = array('fieldname');

To actually display the field with a picture, add the fieldname to your $conf['show_exif_fields'] array.

See also https://exiftool.org/ and specifically https://exiftool.org/#tagnames


Running Piwigo at https://erack.net/gallery/

Offline

 
  •  » Extensions
  •  » Extracting custom metadata from PNG file

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact