Commit a54870aa authored by Maksim Shabunin's avatar Maksim Shabunin

Added filename emptyness check to the Exif reader, fixes 6120

parent 8c591ebd
...@@ -267,6 +267,8 @@ int JpegDecoder::getOrientation() ...@@ -267,6 +267,8 @@ int JpegDecoder::getOrientation()
{ {
int orientation = JPEG_ORIENTATION_TL; int orientation = JPEG_ORIENTATION_TL;
if (m_filename.size() > 0)
{
ExifReader reader( m_filename ); ExifReader reader( m_filename );
if( reader.parse() ) if( reader.parse() )
{ {
...@@ -276,6 +278,7 @@ int JpegDecoder::getOrientation() ...@@ -276,6 +278,7 @@ int JpegDecoder::getOrientation()
orientation = entry.field_u16; //orientation is unsigned short, so check field_u16 orientation = entry.field_u16; //orientation is unsigned short, so check field_u16
} }
} }
}
return orientation; return orientation;
} }
......
...@@ -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