fix exif bug

This commit is contained in:
yaohai [姚海] 2019-08-05 17:11:46 +08:00
parent d2c64b566b
commit cadb4dee14
2 changed files with 3 additions and 6 deletions

View File

@ -229,7 +229,7 @@ void ExifReader::parseExif()
uint32_t offset = getStartOffset();
size_t numEntry = getNumDirEntry();
size_t numEntry = getNumDirEntry( offset );
offset += 2; //go to start of tag fields
@ -303,7 +303,7 @@ uint32_t ExifReader::getStartOffset() const
*
* @return The number of directory entries
*/
size_t ExifReader::getNumDirEntry() const
size_t ExifReader::getNumDirEntry(const size_t offsetNumDir) const
{
return getU16( offsetNumDir );
}

View File

@ -199,7 +199,7 @@ private:
bool checkTagMark() const;
size_t getFieldSize ();
size_t getNumDirEntry() const;
size_t getNumDirEntry( const size_t offsetNumDir ) const;
uint32_t getStartOffset() const;
uint16_t getExifTag( const size_t offset ) const;
uint16_t getU16( const size_t offset ) const;
@ -225,9 +225,6 @@ private:
private:
static const uint16_t tagMarkRequired = 0x2A;
//offset to the _number-of-directory-entry_ field
static const size_t offsetNumDir = 8;
//max size of data in tag.
//'DDDDDDDD' contains the value of that Tag. If its size is over 4bytes,
//'DDDDDDDD' contains the offset to data stored address.