1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Revert CV_TRY/CV_CATCH macros

This reverts commit 7349b8f5ce (partially).
This commit is contained in:
Alexander Alekhin
2018-11-08 19:46:25 +03:00
parent e5d7f446d6
commit b74b05d1b3
18 changed files with 119 additions and 118 deletions
+9 -10
View File
@@ -80,15 +80,14 @@ ExifReader::~ExifReader()
*/
bool ExifReader::parse()
{
CV_TRY {
try {
m_exif = getExif();
if( !m_exif.empty() )
{
return true;
}
return false;
} CV_CATCH (ExifParsingError, e) {
CV_UNUSED(e);
} catch (ExifParsingError&) {
return false;
}
}
@@ -152,11 +151,11 @@ std::map<int, ExifEntry_t > ExifReader::getExif()
case COM:
bytesToSkip = getFieldSize();
if (bytesToSkip < markerSize) {
CV_THROW (ExifParsingError());
throw ExifParsingError();
}
m_stream.seekg( static_cast<long>( bytesToSkip - markerSize ), m_stream.cur );
if ( m_stream.fail() ) {
CV_THROW (ExifParsingError());
throw ExifParsingError();
}
break;
@@ -167,12 +166,12 @@ std::map<int, ExifEntry_t > ExifReader::getExif()
case APP1: //actual Exif Marker
exifSize = getFieldSize();
if (exifSize <= offsetToTiffHeader) {
CV_THROW (ExifParsingError());
throw ExifParsingError();
}
m_data.resize( exifSize - offsetToTiffHeader );
m_stream.seekg( static_cast<long>( offsetToTiffHeader ), m_stream.cur );
if ( m_stream.fail() ) {
CV_THROW (ExifParsingError());
throw ExifParsingError();
}
m_stream.read( reinterpret_cast<char*>(&m_data[0]), exifSize - offsetToTiffHeader );
exifFound = true;
@@ -416,7 +415,7 @@ std::string ExifReader::getString(const size_t offset) const
dataOffset = getU32( offset + 8 );
}
if (dataOffset > m_data.size() || dataOffset + size > m_data.size()) {
CV_THROW (ExifParsingError());
throw ExifParsingError();
}
std::vector<uint8_t>::const_iterator it = m_data.begin() + dataOffset;
std::string result( it, it + size ); //copy vector content into result
@@ -433,7 +432,7 @@ std::string ExifReader::getString(const size_t offset) const
uint16_t ExifReader::getU16(const size_t offset) const
{
if (offset + 1 >= m_data.size())
CV_THROW (ExifParsingError());
throw ExifParsingError();
if( m_format == INTEL )
{
@@ -451,7 +450,7 @@ uint16_t ExifReader::getU16(const size_t offset) const
uint32_t ExifReader::getU32(const size_t offset) const
{
if (offset + 3 >= m_data.size())
CV_THROW (ExifParsingError());
throw ExifParsingError();
if( m_format == INTEL )
{