You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a side note, since ExifTag doesn't have a public constructor, I cannot create my own tags to work around this issue (or to add custom tags to the file).
Steps to Reproduce
Set the DateTimeOffsetTag in a tiff file, then save the file
var image = Image.Load(sourceTifFile);
image.Frames[0].Metadata.ExifProfile = new ExifProfile();
image.Frames[0].Metadata.ExifProfile.SetValue(ExifTag.TimeZoneOffset, new uint[] {1});
image.Save(outputTifFile);
Now run the output tiff file through jhove verification
That looks like a mistake indeed but changing this would introduce a breaking change. But I do wonder if anyone is using this since we implemented this incorrectly. Maybe we could patch this in a minor release and make a note about this minor breaking change in the release notes?
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
3.0.1
Other ImageSharp packages and versions
?
Environment (Operating system, version and so on)
Windows 10 x64
.NET Framework version
.NET 7
Description
The TimeZoneOffset Exif tag is defined in the code as a uint[] (
ImageSharp/src/ImageSharp/Metadata/Profiles/Exif/Tags/ExifTag.LongArray.cs
Line 62 in a49862a
However, the specifications for TIFF/EP which defines that tag seem to require a signed short (optionally two signed shorts). See Page 19 and 40 of the TIFF/EP spec : https://web.archive.org/web/20060212163025/http://www.map.tu.chiba-u.ac.jp/IEC/100/TA2/recdoc/N4378.pdf
This requirement is also encoded in the TIFF verification code in JHove, which then flags the file as non-conformant (https://jhove.openpreservation.org/modules/tiff/tags/ , https://jhove.openpreservation.org/)
As a side note, since ExifTag doesn't have a public constructor, I cannot create my own tags to work around this issue (or to add custom tags to the file).
Steps to Reproduce
Set the DateTimeOffsetTag in a tiff file, then save the file
Now run the output tiff file through jhove verification
You can install jhove on an ubuntu box with
sudo apt-get install jhove default-jre
Note: I ran the ImageSharp test code on Windows, just used Ubuntu for testing as the jhove install is easier
Images
No response
The text was updated successfully, but these errors were encountered: