Skip to content

Can't add exif tag to png image in Unity #1

Description

@tomekkie

First of all, thank you for the great job of creating and sharing this library,

I am trying to add a tag to screenshot made in Unity.
bytes = ImageConversion.EncodeToPNG(screenShot), screenShot.graphicsFormat, (uint)resWidth, (uint)resHeight);
System.IO.File.WriteAllBytes(filePath, bytes);
try
{
ExifData TestExif = new ExifData(filePath);
TestExif.SetTagValue(ExifTag.ImageDescription, "description", StrCoding.Utf8);
TestExif.Save();
}
This works for jpg, but not for png.
Then the ImageDescription tag displays in W11 as "title", and in AdobeBridge as "Description".
But I can not read it back.
Finally I have used ExifReader from here to read it back:
(https://github.com/dxball/TestUnityExif)

The set of tags it supports is not complete.
I am browsing images in AdobeBridge and see that a number of commonly used tags are missing. Some of these missing are:

title
alt text
keywords
headline
copyright status

Some tag names are twisted.
Like copyright tag which is not “copyright” as much as “copyright notice”, while the “copyright status” is missing.

I was hoping I could create a sample file with desired exif data and then use it as exif source for ReplaceAllTagsBy(SourceExif) method.
The method is supposed to copy a complete exif data from a given source image,
Unfortunately this fails, because "ReplaceAllTagsBy(SourceExif)" doesn’t copy the complete exif data, but only a selection of tags including these supported only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions