From abb796c0b2ca17d47936efb4f21a9a23c1b54fda Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 3 May 2020 20:55:56 +0000 Subject: [PATCH] fpexif: Set WriteJFIFandEXIF after reading a file so that existing segments are preserved. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7428 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpexif/fpemetadata.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/fpexif/fpemetadata.pas b/components/fpexif/fpemetadata.pas index e45c7a40f..23142cc3d 100644 --- a/components/fpexif/fpemetadata.pas +++ b/components/fpexif/fpemetadata.pas @@ -465,6 +465,7 @@ var reader: TBasicMetadataReader; bigEndian: Boolean; hdr: TBytes; + hasJFIF: Boolean; {$IFNDEF FPC} sa: ansistring; {$ENDIF} @@ -568,6 +569,7 @@ begin Move(hdr[SizeOf(TJpegJFXXSegment)], FJFXXThumbnail[0], Length(FJFXXThumbnail)); end; end; + hasJFIF := true; end; M_SOF0: begin @@ -584,6 +586,9 @@ begin end; AStream.Position := p + size; end; + + // Force writing of JFIF if it coexists with EXIF. + FWriteJFIFandEXIF := hasJFIF and HasExif; end; procedure TImgInfo.ReadTiff(AStream: TStream);