fix exif bug

pull/15228/head
yaohai [姚海] 6 years ago
parent d2c64b566b
commit cadb4dee14
  1. 4
      modules/imgcodecs/src/exif.cpp
  2. 5
      modules/imgcodecs/src/exif.hpp

@ -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 );
}

@ -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.

Loading…
Cancel
Save