From 8b0b7ab1b46ff3c8559be593c433e24b650c26f7 Mon Sep 17 00:00:00 2001 From: popow Date: Tue, 10 Jul 2018 19:48:42 +0200 Subject: [PATCH] skipping exif id code before extending the exif profile --- .../Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs | 2 +- src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs index 72b5698c5..d539cf37c 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs @@ -489,7 +489,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort else { // if the exif information exceeds 64K, it will be split over multiple APP1 marker - this.MetaData.ExifProfile.Extend(profile); + this.MetaData.ExifProfile.Extend(profile.Skip(6).ToArray()); } } } diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs index 77ce13535..5ab6c59ac 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs @@ -237,9 +237,8 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { int currentLength = this.data.Length; - // the first 6 bytes are Exif00 and will be skipped - Array.Resize(ref this.data, currentLength + bytes.Length - 6); - Buffer.BlockCopy(bytes, 6, this.data, currentLength, bytes.Length - 6); + Array.Resize(ref this.data, currentLength + bytes.Length); + Buffer.BlockCopy(bytes, 0, this.data, currentLength, bytes.Length); } ///