Browse Source

Write padding byte, because the tiff spec requires ifd offset to begin on a word boundary.

pull/2298/head
Brian Popow 4 years ago
parent
commit
b45670878d
  1. 6
      src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs

6
src/ImageSharp/Formats/Tiff/TiffEncoderCore.cs

@ -244,6 +244,12 @@ internal sealed class TiffEncoderCore : IImageEncoderInternals
entriesCollector.ProcessFrameInfo(frame, imageMetadata);
entriesCollector.ProcessImageFormat(this);
if (writer.Position % 2 != 0)
{
// Write padding byte, because the tiff spec requires ifd offset to begin on a word boundary.
writer.Write(0);
}
this.frameMarkers.Add((ifdOffset, (uint)writer.Position));
return this.WriteIfd(writer, entriesCollector.Entries);

Loading…
Cancel
Save