vrcx-team / VRCX

Friendship management tool for VRChat
MIT License
978 stars 184 forks source link

Use EXIF or XMP for screenshot metadata #774

Open jonnyawsom3 opened 5 months ago

jonnyawsom3 commented 5 months ago

Currently metadata is stored as raw text inside a PNG chunk. This means external programs either ignore it or can't read the text. Even exiftool refuses to export the data because it's not a recognised type.

This is especially annoying when trying to convert screenshots into a newer format. I've managed to halve the size of my screenshots losslessly, but the text chunk is always ignored making it useless...

Storing the metadata inside an EXIF chunk instead would mean more programs can read it, and the metadata would be preserved when converting to newer file formats too.

Alternatively, turning the text chunk into an XMP chunk is also an option. Then you can store the metadata in custom fields rather than filling up EXIF's description tag.

Ideally there'd be a button in the screenshot manager section to convert older files to the new format too

Myrkie commented 5 months ago

the current implementation was done on purpose as to make sure it doesn't get stripped by sharing platforms like discord.

jonnyawsom3 commented 5 months ago

Discord only removes metadata from jpegs, and the XMP is still a text chunk with some extra formatting

jonnyawsom3 commented 5 months ago
Test

Here's an example with both EXIF and XMP, it kept both when uploaded to Discord

Myrkie commented 5 months ago
Test

Here's an example with both EXIF and XMP, it kept both when uploaded to Discord

back then discord stripped all exif data this was during time of implementation of vrcxs feature, this is no longer the case and discord now only stripes exif data for GPS tags. back then it was a requirement, now its a stuck in feature and changing it would require migrating thousands of user pictures with wouldn't at all go off perfectly and could risk corruption, don't fix what isn't broken.

Myrkie commented 5 months ago

in your own example EXIF is stripped from that image we just tested it through vanilla discord clients ORG image

image

after being ran through discord through the vanilla client

image

jonnyawsom3 commented 5 months ago

Huh, so it does actually parse the EXIF chunk. Guess XMP would be the option then, although you already said no

Myrkie commented 5 months ago

Huh, so it does actually parse the EXIF chunk. Guess XMP would be the option then, although you already said no

well even if this wasn't the case it would still require migrating possibly thousands of user images to a new format and if we don't do that maintain the old format as well, we don't want to find ourselves in the middle of some funky migrator stage.

GroovyTeacup commented 5 months ago

IIRC I looked into storing exif data at first but went with iTxT bc the PNG format < 1.2 doesn't really support exif data (at least in many decoders/editing software) and would be pointless to force in bc a lot of programs didn't even process it/detect it correctly, even if png 1.2 technically supports it on paper. Even now, imagemagick is about the only thing that detects the metadata we store.

It was part of the problem of going from the original implementation of the mod that did the same thing, but converted images to JPG and then stored metadata, which would be likely more involved and costly to do working on files after they've already been captured/saved.