diff options
author | Hubert Figuière <hub@figuiere.net> | 2021-09-01 13:52:14 -0400 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2021-09-01 15:14:57 -0400 |
commit | 022c5dede74ecd38939acd168212c26d91e11db3 (patch) | |
tree | c415ce2927acb3712dd94f50b4299fae90fd13e9 /XMPFiles/source/FileHandlers/JPEG_Handler.cpp | |
parent | 8db317ecaaf0df53f77091df704b8f1f9858d51a (diff) | |
parent | 77a3fe7096f8ebf301e2bfe1e6dc023b4ff6dc48 (diff) |
Issue #22 - Update SDK to v2021.08
https://gitlab.freedesktop.org/libopenraw/exempi/-/issues/22
Merge branch 'adobe-sdk' into integration
Diffstat (limited to 'XMPFiles/source/FileHandlers/JPEG_Handler.cpp')
-rw-r--r-- | XMPFiles/source/FileHandlers/JPEG_Handler.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/XMPFiles/source/FileHandlers/JPEG_Handler.cpp b/XMPFiles/source/FileHandlers/JPEG_Handler.cpp index b926636..91de9a0 100644 --- a/XMPFiles/source/FileHandlers/JPEG_Handler.cpp +++ b/XMPFiles/source/FileHandlers/JPEG_Handler.cpp @@ -1,13 +1,16 @@ // ================================================================================================= -// ADOBE SYSTEMS INCORPORATED -// Copyright 2004 Adobe Systems Incorporated +// Copyright Adobe +// Copyright 2004 Adobe // All Rights Reserved // // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms -// of the Adobe license agreement accompanying it. +// of the Adobe license agreement accompanying it. // ================================================================================================= #include "public/include/XMP_Environment.h" // ! This must be the first include. + +#include <algorithm> + #include "public/include/XMP_Const.h" #include "public/include/XMP_IO.hpp" @@ -24,8 +27,6 @@ #include "third-party/zuid/interfaces/MD5.h" -#include <algorithm> - using namespace std; // ================================================================================================= @@ -336,7 +337,7 @@ void JPEG_MetaHandler::CacheFileData() size_t psirLen = contentLen - kPSIRSignatureLength; fileRef->Seek ( (contentOrigin + kPSIRSignatureLength), kXMP_SeekFromStart ); - fileRef->ReadAll ( buffer, psirLen ); + fileRef->ReadAll ( buffer, (XMP_Int32)psirLen ); this->psirContents.append( (char *) buffer, psirLen ); continue; // Move on to the next marker. @@ -357,7 +358,7 @@ void JPEG_MetaHandler::CacheFileData() size_t exifLen = contentLen - kExifSignatureLength; fileRef->Seek ( (contentOrigin + kExifSignatureLength), kXMP_SeekFromStart ); - fileRef->ReadAll ( buffer, exifLen ); + fileRef->ReadAll ( buffer, (XMP_Int32)exifLen ); this->exifContents.append ( (char*)buffer, exifLen ); continue; // Move on to the next marker. @@ -369,7 +370,7 @@ void JPEG_MetaHandler::CacheFileData() this->containsXMP = true; // Found the standard XMP packet. size_t xmpLen = contentLen - kMainXMPSignatureLength; fileRef->Seek ( (contentOrigin + kMainXMPSignatureLength), kXMP_SeekFromStart ); - fileRef->ReadAll ( buffer, xmpLen ); + fileRef->ReadAll ( buffer, (XMP_Int32)xmpLen ); this->xmpPacket.assign ( (char*)buffer, xmpLen ); this->packetInfo.offset = contentOrigin + kMainXMPSignatureLength; this->packetInfo.length = (XMP_Int32)xmpLen; @@ -481,8 +482,8 @@ static void TrimFullExifAPP1 ( std::string * exifContents ) TIFF_MemoryReader::TagInfoMap::const_iterator mapEnd = tagMap.end(); for ( ; mapPos != mapEnd; ++mapPos ) { - const TIFF_MemoryReader::TagInfo & value = mapPos->second; - XMP_Uns32 tagEnd = tempMgr.GetValueOffset ( ifd, value.id ) + value.dataLen; + const TIFF_MemoryReader::TagInfo & tagInfoRef = mapPos->second; + XMP_Uns32 tagEnd = tempMgr.GetValueOffset ( ifd, tagInfoRef.id ) + tagInfoRef.dataLen; if ( tagEnd > padOffset ) padOffset = tagEnd; } @@ -511,7 +512,7 @@ static void TrimFullExifAPP1 ( std::string * exifContents ) size_t nzSize = lastNonZero - padOffset + 1; size_t finalSize = (exifContents->size() - 1) - lastNonZero; if ( (nzSize < 64) && (finalSize > 64) ) { - padOffset = lastNonZero + 64; + padOffset = (XMP_Int32)lastNonZero + 64; assert ( padOffset < exifContents->size() ); ok = true; } |