Commit 2549bafe authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #6121 from mshabunin:fix-check-imencode-exif

parents 03d6d204 a54870aa
...@@ -267,13 +267,16 @@ int JpegDecoder::getOrientation() ...@@ -267,13 +267,16 @@ int JpegDecoder::getOrientation()
{ {
int orientation = JPEG_ORIENTATION_TL; int orientation = JPEG_ORIENTATION_TL;
ExifReader reader( m_filename ); if (m_filename.size() > 0)
if( reader.parse() )
{ {
ExifEntry_t entry = reader.getTag( ORIENTATION ); ExifReader reader( m_filename );
if (entry.tag != INVALID_TAG) if( reader.parse() )
{ {
orientation = entry.field_u16; //orientation is unsigned short, so check field_u16 ExifEntry_t entry = reader.getTag( ORIENTATION );
if (entry.tag != INVALID_TAG)
{
orientation = entry.field_u16; //orientation is unsigned short, so check field_u16
}
} }
} }
......
...@@ -128,6 +128,11 @@ std::map<int, ExifEntry_t > ExifReader::getExif() ...@@ -128,6 +128,11 @@ std::map<int, ExifEntry_t > ExifReader::getExif()
size_t count; size_t count;
if (m_filename.size() == 0)
{
return m_exif;
}
FILE* f = fopen( m_filename.c_str(), "rb" ); FILE* f = fopen( m_filename.c_str(), "rb" );
if( !f ) if( !f )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment