From 28b41f59bd954fde31f9143843616d41bb2bcc56 Mon Sep 17 00:00:00 2001 From: Christoph Hasse Date: Thu, 25 Feb 2021 10:42:38 +0100 Subject: [PATCH] run clang-format on new files --- include/exiv2/bmffimage.hpp | 68 ++++--- src/bmffimage.cpp | 351 ++++++++++++++++++------------------ 2 files changed, 212 insertions(+), 207 deletions(-) mode change 100755 => 100644 src/bmffimage.cpp diff --git a/include/exiv2/bmffimage.hpp b/include/exiv2/bmffimage.hpp index 5e2a8601..f29dfdff 100644 --- a/include/exiv2/bmffimage.hpp +++ b/include/exiv2/bmffimage.hpp @@ -32,20 +32,22 @@ namespace Exiv2 { EXIV2API bool enableBMFF(bool enable = true); - class Iloc ;// We'll define this in bmffimage.cpp + class Iloc; // We'll define this in bmffimage.cpp -// ***************************************************************************** -// class definitions + // ***************************************************************************** + // class definitions // Add Base Media File Format to the supported image formats - namespace ImageType { - const int bmff = 15; //!< BMFF (bmff) image type (see class BMFF) + namespace ImageType + { + const int bmff = 15; //!< BMFF (bmff) image type (see class BMFF) } /*! @brief Class to access BMFF images. */ - class EXIV2API BmffImage : public Image { + class EXIV2API BmffImage : public Image + { public: //! @name Creators //@{ @@ -70,11 +72,11 @@ namespace Exiv2 BmffImage(BasicIo::AutoPtr io, size_t start, size_t count); //@} - void parseTiff(uint32_t root_tag,uint32_t length); + void parseTiff(uint32_t root_tag, uint32_t length); //! @name Manipulators //@{ - void readMetadata() /* override */ ; - void writeMetadata() /* override */ ; + void readMetadata() /* override */; + void writeMetadata() /* override */; /*! @brief Print out the structure of image file. @@ -82,18 +84,18 @@ namespace Exiv2 not valid (does not look like data of the specific image type). @warning This function is not thread safe and intended for exiv2 -pS for debugging. */ - void printStructure(std::ostream& out, PrintStructureOption option,int depth) /* override */ ; + void printStructure(std::ostream& out, PrintStructureOption option, int depth) /* override */; /*! @brief Todo: Not supported yet(?). Calling this function will throw an instance of Error(kerInvalidSettingForImage). */ - void setComment(const std::string& comment) /* override */ ; + void setComment(const std::string& comment) /* override */; //@} //! @name Accessors //@{ - std::string mimeType() const /* override */ ; + std::string mimeType() const /* override */; //@} #if 0 BmffImage& operator=(const BmffImage& rhs) /* = delete*/ ; @@ -109,16 +111,22 @@ namespace Exiv2 @return address of next box @warning This function should only be called by readMetadata() */ - long boxHandler(int depth=0); - - uint32_t fileType ; - std::set visits_ ; - uint64_t visits_max_; - std::string indent(int i) { std::string r; while ( i-- > 0 ) r+=std::string(" "); return r; } - - uint16_t unknownID_ ; // 0xffff - uint16_t exifID_ ; - std::map ilocs_; + long boxHandler(int depth = 0); + + uint32_t fileType; + std::set visits_; + uint64_t visits_max_; + std::string indent(int i) + { + std::string r; + while (i-- > 0) + r += std::string(" "); + return r; + } + + uint16_t unknownID_; // 0xffff + uint16_t exifID_; + std::map ilocs_; /*! @brief Provides the main implementation of writeMetadata() by @@ -133,16 +141,16 @@ namespace Exiv2 /*! @brief box utilities */ - std::string toAscii (long n); - std::string boxName (uint32_t box); - bool superBox(uint32_t box); - bool fullBox (uint32_t box); + std::string toAscii(long n); + std::string boxName(uint32_t box); + bool superBox(uint32_t box); + bool fullBox(uint32_t box); std::string uuidName(Exiv2::DataBuf& uuid); - }; // class BmffImage + }; // class BmffImage -// ***************************************************************************** -// template, inline and free functions + // ***************************************************************************** + // template, inline and free functions // These could be static private functions on Image subclasses but then // ImageFactory needs to be made a friend. @@ -155,4 +163,4 @@ namespace Exiv2 //! Check if the file iIo is a BMFF image. EXIV2API bool isBmffType(BasicIo& iIo, bool advance); -} // namespace Exiv2 +} // namespace Exiv2 diff --git a/src/bmffimage.cpp b/src/bmffimage.cpp old mode 100755 new mode 100644 index eeb32d54..42b4dde5 --- a/src/bmffimage.cpp +++ b/src/bmffimage.cpp @@ -23,26 +23,26 @@ #define EXIV2_DEBUG_MESSAGES // included header files -#include "config.h" +#include "bmffimage.hpp" +#include "basicio.hpp" +#include "config.h" +#include "error.hpp" +#include "futils.hpp" #include "image.hpp" #include "image_int.hpp" +#include "safe_op.hpp" #include "tiffimage.hpp" #include "tiffimage_int.hpp" -#include "bmffimage.hpp" -#include "basicio.hpp" -#include "error.hpp" -#include "futils.hpp" #include "types.hpp" -#include "safe_op.hpp" #include "unused.h" // + standard includes -#include -#include -#include #include #include +#include +#include +#include struct BmffBoxHeader { @@ -54,7 +54,7 @@ struct BmffBoxHeader #define TAG_avif 0x61766966 /**< "avif" AVIF */ #define TAG_heic 0x68656963 /**< "heic" HEIC */ #define TAG_heif 0x68656966 /**< "heif" HEIF */ -#define TAG_crx 0x63727820 /**< "crx " Canon CR3 */ +#define TAG_crx 0x63727820 /**< "crx " Canon CR3 */ #define TAG_moov 0x6d6f6f76 /**< "moov" Movie */ #define TAG_meta 0x6d657461 /**< "meta" Metadata */ #define TAG_mdat 0x6d646174 /**< "mdat" Media data */ @@ -72,7 +72,6 @@ struct BmffBoxHeader #define TAG_cmt3 0x434D5433 /**< canonID */ #define TAG_cmt4 0x434D5434 /**< gpsID */ - // ***************************************************************************** // class member definitions namespace Exiv2 @@ -84,153 +83,141 @@ namespace Exiv2 #ifdef EXV_ENABLE_BMFF enabled = enable; return true; -#endif // EXV_ENABLE_BMFF - enable = false; // unused +#endif // EXV_ENABLE_BMFF + enable = false; // unused return enable; } - class Iloc + class Iloc { public: - Iloc(uint32_t ID=0,uint32_t start=0,uint32_t length=0) - : ID_ (ID) - , start_ (start ) - , length_ (length) - {}; - virtual ~Iloc() {} ; - - uint32_t ID_ ; - uint32_t start_ ; - uint32_t length_ ; - - std::string toString(long address=0) const { - return Internal::stringFormat("ID = %d from,length = %d,%d", ID_,start_+address,length_); + Iloc(uint32_t ID = 0, uint32_t start = 0, uint32_t length = 0) : ID_(ID), start_(start), length_(length){}; + virtual ~Iloc(){}; + + uint32_t ID_; + uint32_t start_; + uint32_t length_; + + std::string toString(long address = 0) const + { + return Internal::stringFormat("ID = %d from,length = %d,%d", ID_, start_ + address, length_); } - }; // class Iloc + }; // class Iloc - BmffImage::BmffImage(BasicIo::AutoPtr io, bool /* create */) - : Image(ImageType::bmff, mdExif | mdIptc | mdXmp, io) + BmffImage::BmffImage(BasicIo::AutoPtr io, bool /* create */) : Image(ImageType::bmff, mdExif | mdIptc | mdXmp, io) { - pixelWidth_ =0; - pixelHeight_ =0; - } // BmffImage::BmffImage + pixelWidth_ = 0; + pixelHeight_ = 0; + } // BmffImage::BmffImage std::string BmffImage::toAscii(long n) { - const char* p = (const char*) &n; + const char* p = (const char*)&n; std::string result; bool bBigEndian = isBigEndianPlatform(); - for ( int i = 0 ; i < 4 ; i++) { - result += p[ bBigEndian ? i : (3-i) ]; + for (int i = 0; i < 4; i++) { + result += p[bBigEndian ? i : (3 - i)]; } return result; } std::string BmffImage::boxName(uint32_t box) { - char name[5]; - std::memcpy (name,&box,4); - name[4] = 0 ; - return std::string(name) ; + char name[5]; + std::memcpy(name, &box, 4); + name[4] = 0; + return std::string(name); } bool BmffImage::superBox(uint32_t box) { - return box == TAG_moov - || box == TAG_dinf - || box == TAG_iprp - || box == TAG_ipco - || box == TAG_meta - || box == TAG_iinf - || box == TAG_iloc - ; + return box == TAG_moov || box == TAG_dinf || box == TAG_iprp || box == TAG_ipco || box == TAG_meta || + box == TAG_iinf || box == TAG_iloc; } bool BmffImage::fullBox(uint32_t box) { - return box == TAG_meta - || box == TAG_iinf - || box == TAG_iloc - ; + return box == TAG_meta || box == TAG_iinf || box == TAG_iloc; } std::string BmffImage::mimeType() const { - switch (fileType) - { - case TAG_avif: return "image/avif"; + switch (fileType) { + case TAG_avif: + return "image/avif"; case TAG_heic: - case TAG_heif: return "image/heif"; - case TAG_crx : return "image/x-canon-cr3"; - default : return "image/generic"; + case TAG_heif: + return "image/heif"; + case TAG_crx: + return "image/x-canon-cr3"; + default: + return "image/generic"; } } std::string BmffImage::uuidName(Exiv2::DataBuf& uuid) { const char* uuidCano = "\x85\xC0\xB6\x87\x82\xF\x11\xE0\x81\x11\xF4\xCE\x46\x2B\x6A\x48"; - const char* uuidXmp = "\xBE\x7A\xCF\xCB\x97\xA9\x42\xE8\x9C\x71\x99\x94\x91\xE3\xAF\xAC"; + const char* uuidXmp = "\xBE\x7A\xCF\xCB\x97\xA9\x42\xE8\x9C\x71\x99\x94\x91\xE3\xAF\xAC"; const char* uuidCanp = "\xEA\xF4\x2B\x5E\x1C\x98\x4B\x88\xB9\xFB\xB7\xDC\x40\x6E\x4D\x16"; - const char* result = std::memcmp(uuid.pData_, uuidCano, 16) == 0 ? "cano" - : std::memcmp(uuid.pData_, uuidXmp, 16) == 0 ? "xmp" + const char* result = std::memcmp(uuid.pData_, uuidCano, 16) == 0 ? "cano" + : std::memcmp(uuid.pData_, uuidXmp, 16) == 0 ? "xmp" : std::memcmp(uuid.pData_, uuidCanp, 16) == 0 ? "canp" - : "" ; + : ""; return result; } long BmffImage::boxHandler(int depth /* =0 */) { - long result = (long) io_->size(); - long address = (long) io_->tell(); - if ( visits_.find(address) != visits_.end() || visits_.size() > visits_max_ ) { + long result = (long)io_->size(); + long address = (long)io_->tell(); + if (visits_.find(address) != visits_.end() || visits_.size() > visits_max_) { throw Error(kerCorruptedMetadata); } visits_.insert(address); - BmffBoxHeader box = {0,0}; - if ( io_->read((byte*)&box, sizeof(box)) != sizeof(box)) return result; + BmffBoxHeader box = {0, 0}; + if (io_->read((byte*)&box, sizeof(box)) != sizeof(box)) + return result; box.length = getLong((byte*)&box.length, bigEndian); - box.type = getLong((byte*)&box.type, bigEndian); + box.type = getLong((byte*)&box.type, bigEndian); #ifdef EXIV2_DEBUG_MESSAGES bool bLF = true; std::cerr << indent(depth) << "Exiv2::BmffImage::boxHandler: " << toAscii(box.type) - << Internal::stringFormat(" %8ld->%u ",address,box.length) - ; + << Internal::stringFormat(" %8ld->%u ", address, box.length); #endif - if ( box.length == 1 ) { + if (box.length == 1) { DataBuf data(8); - io_->read(data.pData_,data.size_ ); - result = address + (long) getULongLong(data.pData_,littleEndian); + io_->read(data.pData_, data.size_); + result = address + (long)getULongLong(data.pData_, littleEndian); // sanity check - if ( result < 0 || result > (long) io_->size() ) { - result = (long) io_->size(); - box.length = result - address; + if (result < 0 || result > (long)io_->size()) { + result = (long)io_->size(); + box.length = result - address; } - std::cerr << Internal::stringFormat(" (%lu)",result); + std::cerr << Internal::stringFormat(" (%lu)", result); } // read data in box and restore file position - long restore = io_->tell(); - DataBuf data(box.length-8); - io_->read(data.pData_,data.size_ ); - io_->seek(restore ,BasicIo::beg); - - uint32_t skip = 0 ; // read position in data.pData_ - uint8_t version = 0 ; - uint32_t flags = 0 ; - - if ( fullBox(box.type) ) { - flags = getLong(data.pData_+skip,bigEndian) ; // version/flags - version = (int8_t ) flags >> 24 ; - version &= 0x00ffffff ; - skip += 4 ; + long restore = io_->tell(); + DataBuf data(box.length - 8); + io_->read(data.pData_, data.size_); + io_->seek(restore, BasicIo::beg); + + uint32_t skip = 0; // read position in data.pData_ + uint8_t version = 0; + uint32_t flags = 0; + + if (fullBox(box.type)) { + flags = getLong(data.pData_ + skip, bigEndian); // version/flags + version = (int8_t)flags >> 24; + version &= 0x00ffffff; + skip += 4; } - switch (box.type) - { - case TAG_ftyp: - { + switch (box.type) { + case TAG_ftyp: { fileType = getLong(data.pData_, bigEndian); #ifdef EXIV2_DEBUG_MESSAGES std::cerr << "Brand: " << toAscii(fileType); @@ -238,52 +225,51 @@ namespace Exiv2 } break; // 8.11.6.1 - case TAG_iinf: - { + case TAG_iinf: { #ifdef EXIV2_DEBUG_MESSAGES std::cerr << std::endl; - bLF=false; + bLF = false; #endif - int n = getShort(data.pData_+skip,bigEndian) ; - skip+= 2 ; + int n = getShort(data.pData_ + skip, bigEndian); + skip += 2; - io_->seek(skip,BasicIo::cur); - while ( n-- > 0 ) - io_->seek(boxHandler(depth+1),BasicIo::beg); + io_->seek(skip, BasicIo::cur); + while (n-- > 0) + io_->seek(boxHandler(depth + 1), BasicIo::beg); } break; // 8.11.6.2 - case TAG_infe : { // .__._.__hvc1_ 2 0 0 1 0 1 0 0 104 118 99 49 0 - /* getLong (data.pData_+skip,bigEndian) ; */ skip+=4; - uint16_t ID = getShort(data.pData_+skip,bigEndian) ; skip+=2; - /* getShort(data.pData_+skip,bigEndian) ; */ skip+=2; // protection - std::string name((const char*)data.pData_+skip); - if ( name.find("Exif")== 0 ) { // "Exif" or "ExifExif" - exifID_ = ID ; + case TAG_infe: { // .__._.__hvc1_ 2 0 0 1 0 1 0 0 104 118 99 49 0 + /* getLong (data.pData_+skip,bigEndian) ; */ skip += 4; + uint16_t ID = getShort(data.pData_ + skip, bigEndian); + skip += 2; + /* getShort(data.pData_+skip,bigEndian) ; */ skip += 2; // protection + std::string name((const char*)data.pData_ + skip); + if (name.find("Exif") == 0) { // "Exif" or "ExifExif" + exifID_ = ID; } #ifdef EXIV2_DEBUG_MESSAGES - std::cerr << Internal::stringFormat("%3d ",ID) << name << " "; + std::cerr << Internal::stringFormat("%3d ", ID) << name << " "; #endif } break; - case TAG_moov: case TAG_iprp: case TAG_ipco: case TAG_meta: { #ifdef EXIV2_DEBUG_MESSAGES std::cerr << std::endl; - bLF=false; + bLF = false; #endif - io_->seek(skip,BasicIo::cur); - while ( (long) io_->tell() < (long)(address + box.length) ) { - io_->seek(boxHandler(depth+1),BasicIo::beg); + io_->seek(skip, BasicIo::cur); + while ((long)io_->tell() < (long)(address + box.length)) { + io_->seek(boxHandler(depth + 1), BasicIo::beg); } - if ( box.type == TAG_meta && ilocs_.find(exifID_) != ilocs_.end() ) { + if (box.type == TAG_meta && ilocs_.find(exifID_) != ilocs_.end()) { const Iloc& iloc = ilocs_.find(exifID_)->second; #ifdef EXIV2_DEBUG_MESSAGES - std::cerr << indent(depth) << "Exiv2::BMFF Exif: " << iloc.toString(address+20) << std::endl; + std::cerr << indent(depth) << "Exiv2::BMFF Exif: " << iloc.toString(address + 20) << std::endl; #endif // parseTiff(Internal::Tag::root,iloc.length_,iloc.start_+address); exifID_ = unknownID_; @@ -292,9 +278,9 @@ namespace Exiv2 // 8.11.3.1 case TAG_iloc: { - uint8_t u = data.pData_[skip++]; - uint16_t offsetSize = u >> 4 ; - uint16_t lengthSize = u & 0xF ; + uint8_t u = data.pData_[skip++]; + uint16_t offsetSize = u >> 4; + uint16_t lengthSize = u & 0xF; #if 0 uint16_t indexSize = 0 ; u = data.pData_[skip++]; @@ -304,50 +290,52 @@ namespace Exiv2 #else skip++; #endif - uint32_t itemCount = version < 2 ? getShort(data.pData_+skip,bigEndian) : getLong(data.pData_+skip,bigEndian); - skip += version < 2 ? 2 : 4 ; - if ( itemCount && itemCount < box.length/14 && offsetSize == 4 && lengthSize == 4 && ((box.length-16) % itemCount) == 0 ) { + uint32_t itemCount = + version < 2 ? getShort(data.pData_ + skip, bigEndian) : getLong(data.pData_ + skip, bigEndian); + skip += version < 2 ? 2 : 4; + if (itemCount && itemCount < box.length / 14 && offsetSize == 4 && lengthSize == 4 && + ((box.length - 16) % itemCount) == 0) { #ifdef EXIV2_DEBUG_MESSAGES std::cerr << std::endl; - bLF=false; + bLF = false; #endif - uint32_t step = (box.length-16)/itemCount ; // length of data per item. + uint32_t step = (box.length - 16) / itemCount; // length of data per item. uint32_t base = skip; - for ( uint32_t i = 0 ; i < itemCount ; i++ ) { - skip=base+i*step ; // move in 16 or 14 byte steps - uint32_t ID = version > 2 ? getLong(data.pData_+skip,bigEndian) : getShort(data.pData_+skip,bigEndian); - uint32_t offset = getLong(data.pData_+skip+step-8,bigEndian); - uint32_t ldata = getLong(data.pData_+skip+step-4,bigEndian); + for (uint32_t i = 0; i < itemCount; i++) { + skip = base + i * step; // move in 16 or 14 byte steps + uint32_t ID = version > 2 ? getLong(data.pData_ + skip, bigEndian) + : getShort(data.pData_ + skip, bigEndian); + uint32_t offset = getLong(data.pData_ + skip + step - 8, bigEndian); + uint32_t ldata = getLong(data.pData_ + skip + step - 4, bigEndian); #ifdef EXIV2_DEBUG_MESSAGES std::cerr << indent(depth) - << Internal::stringFormat("%8ld | %8u | ext | %4u | %6u,%6u",address+skip,step,ID,offset,ldata) - << std::endl - ; + << Internal::stringFormat("%8ld | %8u | ext | %4u | %6u,%6u", address + skip, step, + ID, offset, ldata) + << std::endl; #endif - ilocs_[ID] = Iloc(ID,offset,ldata); + ilocs_[ID] = Iloc(ID, offset, ldata); } } } break; case TAG_ispe: { - skip+=4; - int width = (int) getLong(data.pData_ + skip, bigEndian); skip+=4; - int height = (int) getLong(data.pData_ + skip, bigEndian); skip+=4; + skip += 4; + int width = (int)getLong(data.pData_ + skip, bigEndian); + skip += 4; + int height = (int)getLong(data.pData_ + skip, bigEndian); + skip += 4; #ifdef EXIV2_DEBUG_MESSAGES - std::cerr << "pixelWidth_, pixelHeight_ = " - << Internal::stringFormat("%d, %d", width, height) - ; + std::cerr << "pixelWidth_, pixelHeight_ = " << Internal::stringFormat("%d, %d", width, height); // HEIC files can have multiple ispe records // Store largest width/height - if ( width > pixelWidth_ && height > pixelHeight_ ) { - pixelWidth_ = width ; - pixelHeight_ = height ; + if (width > pixelWidth_ && height > pixelHeight_) { + pixelWidth_ = width; + pixelHeight_ = height; } #endif } break; - case TAG_uuid: - { + case TAG_uuid: { DataBuf uuid(16); io_->read(uuid.pData_, uuid.size_); std::string name = uuidName(uuid); @@ -361,26 +349,37 @@ namespace Exiv2 } } break; - case TAG_cmt1: parseTiff(Internal::Tag::root ,box.length); break; - case TAG_cmt2: parseTiff(Internal::Tag::cr3_exif,box.length); break; - case TAG_cmt3: parseTiff(Internal::Tag::cr3_mn ,box.length); break; - case TAG_cmt4: parseTiff(Internal::Tag::cr3_gps ,box.length); break; - - default: {} ; /* do nothing */ + case TAG_cmt1: + parseTiff(Internal::Tag::root, box.length); + break; + case TAG_cmt2: + parseTiff(Internal::Tag::cr3_exif, box.length); + break; + case TAG_cmt3: + parseTiff(Internal::Tag::cr3_mn, box.length); + break; + case TAG_cmt4: + parseTiff(Internal::Tag::cr3_gps, box.length); + break; + + default: { + }; /* do nothing */ } #ifdef EXIV2_DEBUG_MESSAGES - if ( bLF ) std::cerr << std::endl; + if (bLF) + std::cerr << std::endl; #endif // return address of next box - if ( box.length != 1 ) result = static_cast(address + box.length); + if (box.length != 1) + result = static_cast(address + box.length); - return result ; + return result; } - void BmffImage::parseTiff(uint32_t root_tag,uint32_t length) + void BmffImage::parseTiff(uint32_t root_tag, uint32_t length) { - if ( length > 8 ) { - DataBuf data(length - 8); + if (length > 8) { + DataBuf data(length - 8); // rawData.alloc(length - 8); long bufRead = io_->read(data.pData_, data.size_); @@ -390,7 +389,7 @@ namespace Exiv2 throw Error(kerInputDataReadFailed); Internal::TiffParserWorker::decode(exifData(), iptcData(), xmpData(), data.pData_, data.size_, root_tag, - Internal::TiffMapping::findDecoder); + Internal::TiffMapping::findDecoder); } } @@ -398,34 +397,34 @@ namespace Exiv2 { // Todo: implement me! throw(Error(kerInvalidSettingForImage, "Image comment", "BMFF")); - } // BmffImage::setComment + } // BmffImage::setComment void BmffImage::readMetadata() { - if (io_->open() != 0) - { + if (io_->open() != 0) { throw Error(kerDataSourceOpenFailed, io_->path(), strError()); } IoCloser closer(*io_); // Ensure that this is the correct image type if (!isBmffType(*io_, false)) { - if (io_->error() || io_->eof()) throw Error(kerFailedToReadImageData); + if (io_->error() || io_->eof()) + throw Error(kerFailedToReadImageData); throw Error(kerNotAnImage, "BMFF"); } - ilocs_ .clear() ; + ilocs_.clear(); visits_.clear(); visits_max_ = io_->size() / 16; - unknownID_ = 0xffff ; - exifID_ = unknownID_ ; + unknownID_ = 0xffff; + exifID_ = unknownID_; - long address = 0 ; - while ( address < (long) io_->size() ) { - io_->seek(address,BasicIo::beg); + long address = 0; + while (address < (long)io_->size()) { + io_->seek(address, BasicIo::beg); address = boxHandler(); } - } // BmffImage::readMetadata + } // BmffImage::readMetadata void BmffImage::printStructure(std::ostream& out, PrintStructureOption option, int depth) { @@ -441,19 +440,18 @@ namespace Exiv2 UNUSED(out); UNUSED(option); UNUSED(depth); - } // BmffImage::printStructure + } // BmffImage::printStructure void BmffImage::writeMetadata() { - } // BmffImage::writeMetadata + } // BmffImage::writeMetadata // ************************************************************************* // free functions Image::AutoPtr newBmffInstance(BasicIo::AutoPtr io, bool create) { Image::AutoPtr image(new BmffImage(io, create)); - if (!image->good()) - { + if (!image->good()) { image.reset(); } return image; @@ -461,8 +459,7 @@ namespace Exiv2 bool isBmffType(BasicIo& iIo, bool advance) { - if (!enabled) - { + if (!enabled) { return false; } const int32_t len = 12; @@ -478,4 +475,4 @@ namespace Exiv2 } return matched; } -} // namespace Exiv2 +} // namespace Exiv2