Revert style changes

main
Miloš Komarčević 4 years ago
parent 4c52861a74
commit 0da1a50afe

@ -41,7 +41,7 @@ The file ReadMe.txt in a build bundle describes how to install the library on th
16. [Cross Platform Build and Test on Linux for MinGW](#2-16) 16. [Cross Platform Build and Test on Linux for MinGW](#2-16)
17. [Building with C++11 and other compilers](#2-17) 17. [Building with C++11 and other compilers](#2-17)
18. [Static and Shared Libraries](#2-18) 18. [Static and Shared Libraries](#2-18)
19. [Support for bmff files (CR3, HEIF, HEIC, and AVIF)](#2-19) 19. [Support for bmff files (CR3, HEIF and AVIF)](#2-19)
3. [License and Support](#3) 3. [License and Support](#3)
1. [License](#3-1) 1. [License](#3-1)
2. [Support](#3-2) 2. [Support](#3-2)
@ -783,7 +783,7 @@ This is discussed: [https://github.com/Exiv2/exiv2/issues/1230](https://github.c
<div id="2-19"> <div id="2-19">
2.19 Support for bmff files (CR3, HEIF, HEIC, and AVIF) 2.19 Support for bmff files (CR3, HEIF and AVIF)
**Attention is drawn to the possibility that bmff support may be the subject of patent rights. _Exiv2 shall not be held responsible for identifying any or all such patent rights. Exiv2 shall not be held responsible for the legal consequences of the use of this code_.** **Attention is drawn to the possibility that bmff support may be the subject of patent rights. _Exiv2 shall not be held responsible for identifying any or all such patent rights. Exiv2 shall not be held responsible for the legal consequences of the use of this code_.**

@ -72,4 +72,4 @@
#include "exiv2/xmp_exiv2.hpp" #include "exiv2/xmp_exiv2.hpp"
#include "exiv2/xmpsidecar.hpp" #include "exiv2/xmpsidecar.hpp"
#endif //ifndef EXIV2_HPP_ #endif//ifndef EXIV2_HPP_

@ -49,7 +49,6 @@ DNG Read/Write Read/Write Read/Write - Read/Write
EPS - - Read/Write - - EPS - - Read/Write - -
EXV Read/Write Read/Write Read/Write Read/Write Read/Write EXV Read/Write Read/Write Read/Write Read/Write Read/Write
GIF - - - - - GIF - - - - -
HEIC Read Read Read - -
HEIF Read Read Read - - HEIF Read Read Read - -
JP2 Read/Write Read/Write Read/Write - Read/Write JP2 Read/Write Read/Write Read/Write - Read/Write
JPEG Read/Write Read/Write Read/Write Read/Write Read/Write JPEG Read/Write Read/Write Read/Write Read/Write Read/Write

@ -33,7 +33,7 @@
#ifdef EXV_ENABLE_BMFF #ifdef EXV_ENABLE_BMFF
#include "bmffimage.hpp" #include "bmffimage.hpp"
#endif // EXV_ENABLE_BMFF #endif// EXV_ENABLE_BMFF
#include "cr2image.hpp" #include "cr2image.hpp"
#include "crwimage.hpp" #include "crwimage.hpp"
#include "epsimage.hpp" #include "epsimage.hpp"
@ -41,7 +41,7 @@
#include "mrwimage.hpp" #include "mrwimage.hpp"
#ifdef EXV_HAVE_LIBZ #ifdef EXV_HAVE_LIBZ
# include "pngimage.hpp" # include "pngimage.hpp"
#endif // EXV_HAVE_LIBZ #endif// EXV_HAVE_LIBZ
#include "rafimage.hpp" #include "rafimage.hpp"
#include "tiffimage.hpp" #include "tiffimage.hpp"
#include "tiffimage_int.hpp" #include "tiffimage_int.hpp"
@ -61,7 +61,7 @@
#include "quicktimevideo.hpp" #include "quicktimevideo.hpp"
#include "riffvideo.hpp" #include "riffvideo.hpp"
#include "asfvideo.hpp" #include "asfvideo.hpp"
#endif // EXV_ENABLE_VIDEO #endif// EXV_ENABLE_VIDEO
#include "rw2image.hpp" #include "rw2image.hpp"
#include "pgfimage.hpp" #include "pgfimage.hpp"
#include "xmpsidecar.hpp" #include "xmpsidecar.hpp"
@ -176,7 +176,7 @@ namespace Exiv2 {
{ {
} }
void Image::printStructure(std::ostream&, PrintStructureOption, int /*depth*/) void Image::printStructure(std::ostream&, PrintStructureOption,int /*depth*/)
{ {
throw Error(kerUnsupportedImageType, io_->path()); throw Error(kerUnsupportedImageType, io_->path());
} }
@ -248,7 +248,7 @@ namespace Exiv2 {
} }
bool Image::isLittleEndianPlatform() { return !isBigEndianPlatform(); } bool Image::isLittleEndianPlatform() { return !isBigEndianPlatform(); }
uint64_t Image::byteSwap(uint64_t value, bool bSwap) const uint64_t Image::byteSwap(uint64_t value,bool bSwap) const
{ {
uint64_t result = 0; uint64_t result = 0;
byte* source_value = reinterpret_cast<byte *>(&value); byte* source_value = reinterpret_cast<byte *>(&value);
@ -260,7 +260,7 @@ namespace Exiv2 {
return bSwap ? result : value; return bSwap ? result : value;
} }
uint32_t Image::byteSwap(uint32_t value, bool bSwap) const uint32_t Image::byteSwap(uint32_t value,bool bSwap) const
{ {
uint32_t result = 0; uint32_t result = 0;
result |= (value & 0x000000FF) << 24; result |= (value & 0x000000FF) << 24;
@ -270,7 +270,7 @@ namespace Exiv2 {
return bSwap ? result : value; return bSwap ? result : value;
} }
uint16_t Image::byteSwap(uint16_t value, bool bSwap) const uint16_t Image::byteSwap(uint16_t value,bool bSwap) const
{ {
uint16_t result = 0; uint16_t result = 0;
result |= (value & 0x00FF) << 8; result |= (value & 0x00FF) << 8;
@ -278,16 +278,16 @@ namespace Exiv2 {
return bSwap ? result : value; return bSwap ? result : value;
} }
uint16_t Image::byteSwap2(const DataBuf& buf, size_t offset, bool bSwap) const uint16_t Image::byteSwap2(const DataBuf& buf,size_t offset,bool bSwap) const
{ {
uint16_t v; uint16_t v;
char* p = (char*) &v; char* p = (char*) &v;
p[0] = buf.pData_[offset]; p[0] = buf.pData_[offset];
p[1] = buf.pData_[offset+1]; p[1] = buf.pData_[offset+1];
return Image::byteSwap(v, bSwap); return Image::byteSwap(v,bSwap);
} }
uint32_t Image::byteSwap4(const DataBuf& buf, size_t offset, bool bSwap) const uint32_t Image::byteSwap4(const DataBuf& buf,size_t offset,bool bSwap) const
{ {
uint32_t v; uint32_t v;
char* p = (char*) &v; char* p = (char*) &v;
@ -295,10 +295,10 @@ namespace Exiv2 {
p[1] = buf.pData_[offset+1]; p[1] = buf.pData_[offset+1];
p[2] = buf.pData_[offset+2]; p[2] = buf.pData_[offset+2];
p[3] = buf.pData_[offset+3]; p[3] = buf.pData_[offset+3];
return Image::byteSwap(v, bSwap); return Image::byteSwap(v,bSwap);
} }
uint64_t Image::byteSwap8(const DataBuf& buf, size_t offset, bool bSwap) const uint64_t Image::byteSwap8(const DataBuf& buf,size_t offset,bool bSwap) const
{ {
uint64_t v; uint64_t v;
byte* p = reinterpret_cast<byte *>(&v); byte* p = reinterpret_cast<byte *>(&v);
@ -306,7 +306,7 @@ namespace Exiv2 {
for(int i = 0; i < 8; i++) for(int i = 0; i < 8; i++)
p[i] = buf.pData_[offset + i]; p[i] = buf.pData_[offset + i];
return Image::byteSwap(v, bSwap); return Image::byteSwap(v,bSwap);
} }
const char* Image::typeName(uint16_t tag) const const char* Image::typeName(uint16_t tag) const
@ -338,7 +338,7 @@ namespace Exiv2 {
} }
static std::set<long> visits; // #547 static std::set<long> visits; // #547
void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option, uint32_t start, bool bSwap, char c, int depth) void Image::printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,uint32_t start,bool bSwap,char c,int depth)
{ {
depth++; depth++;
if ( depth == 1 ) visits.clear(); if ( depth == 1 ) visits.clear();
@ -351,18 +351,18 @@ namespace Exiv2 {
do { do {
// Read top of directory // Read top of directory
const int seekSuccess = !io.seek(start, BasicIo::beg); const int seekSuccess = !io.seek(start,BasicIo::beg);
const long bytesRead = io.read(dir.pData_, 2); const long bytesRead = io.read(dir.pData_, 2);
if (!seekSuccess || bytesRead == 0) { if (!seekSuccess || bytesRead == 0) {
throw Error(kerCorruptedMetadata); throw Error(kerCorruptedMetadata);
} }
uint16_t dirLength = byteSwap2(dir, 0, bSwap); uint16_t dirLength = byteSwap2(dir,0,bSwap);
bool tooBig = dirLength > 500; bool tooBig = dirLength > 500;
if ( tooBig ) throw Error(kerTiffDirectoryTooLarge); if ( tooBig ) throw Error(kerTiffDirectoryTooLarge);
if ( bFirst && bPrint ) { if ( bFirst && bPrint ) {
out << Internal::indent(depth) << Internal::stringFormat("STRUCTURE OF TIFF FILE (%c%c): ", c, c) << io.path() << std::endl; out << Internal::indent(depth) << Internal::stringFormat("STRUCTURE OF TIFF FILE (%c%c): ",c,c) << io.path() << std::endl;
if ( tooBig ) out << Internal::indent(depth) << "dirLength = " << dirLength << std::endl; if ( tooBig ) out << Internal::indent(depth) << "dirLength = " << dirLength << std::endl;
} }
@ -381,10 +381,10 @@ namespace Exiv2 {
bFirst = false; bFirst = false;
io.read(dir.pData_, 12); io.read(dir.pData_, 12);
uint16_t tag = byteSwap2(dir, 0, bSwap); uint16_t tag = byteSwap2(dir,0,bSwap);
uint16_t type = byteSwap2(dir, 2, bSwap); uint16_t type = byteSwap2(dir,2,bSwap);
uint32_t count = byteSwap4(dir, 4, bSwap); uint32_t count = byteSwap4(dir,4,bSwap);
uint32_t offset = byteSwap4(dir, 8, bSwap); uint32_t offset = byteSwap4(dir,8,bSwap);
// Break for unknown tag types else we may segfault. // Break for unknown tag types else we may segfault.
if ( !typeValid(type) ) { if ( !typeValid(type) ) {
@ -396,8 +396,8 @@ namespace Exiv2 {
std::string sp = "" ; // output spacer std::string sp = "" ; // output spacer
//prepare to print the value //prepare to print the value
uint32_t kount = isPrintXMP(tag, option) ? count // haul in all the data uint32_t kount = isPrintXMP(tag,option) ? count // haul in all the data
: isPrintICC(tag, option) ? count // ditto : isPrintICC(tag,option) ? count // ditto
: isStringType(type) ? (count > 32 ? 32 : count) // restrict long arrays : isStringType(type) ? (count > 32 ? 32 : count) // restrict long arrays
: count > 5 ? 5 : count > 5 ? 5
: count : count
@ -419,13 +419,13 @@ namespace Exiv2 {
} }
DataBuf buf((long)allocate); // allocate a buffer DataBuf buf((long)allocate); // allocate a buffer
std::memset(buf.pData_, 0, buf.size_); std::memset(buf.pData_, 0, buf.size_);
std::memcpy(buf.pData_, dir.pData_+8, 4); // copy dir[8:11] into buffer (short strings) std::memcpy(buf.pData_,dir.pData_+8,4); // copy dir[8:11] into buffer (short strings)
const bool bOffsetIsPointer = count*size > 4; const bool bOffsetIsPointer = count*size > 4;
if ( bOffsetIsPointer ) { // read into buffer if ( bOffsetIsPointer ) { // read into buffer
size_t restore = io.tell(); // save size_t restore = io.tell(); // save
io.seek(offset, BasicIo::beg); // position io.seek(offset,BasicIo::beg); // position
io.read(buf.pData_, count*size);// read io.read(buf.pData_,count*size);// read
io.seek(restore,BasicIo::beg); // restore io.seek(restore,BasicIo::beg); // restore
} }
@ -436,23 +436,23 @@ namespace Exiv2 {
""; "";
out << Internal::indent(depth) out << Internal::indent(depth)
<< Internal::stringFormat("%8u | %#06x %-28s |%10s |%9u |%10s | ", << Internal::stringFormat("%8u | %#06x %-28s |%10s |%9u |%10s | "
address, tag, tagName(tag).c_str(), typeName(type), count, offsetString.c_str()); ,address,tag,tagName(tag).c_str(),typeName(type),count,offsetString.c_str());
if ( isShortType(type) ){ if ( isShortType(type) ){
for ( size_t k = 0 ; k < kount ; k++ ) { for ( size_t k = 0 ; k < kount ; k++ ) {
out << sp << byteSwap2(buf, k*size, bSwap); out << sp << byteSwap2(buf,k*size,bSwap);
sp = " "; sp = " ";
} }
} else if ( isLongType(type) ){ } else if ( isLongType(type) ){
for ( size_t k = 0 ; k < kount ; k++ ) { for ( size_t k = 0 ; k < kount ; k++ ) {
out << sp << byteSwap4(buf, k*size, bSwap); out << sp << byteSwap4(buf,k*size,bSwap);
sp = " "; sp = " ";
} }
} else if ( isRationalType(type) ){ } else if ( isRationalType(type) ){
for ( size_t k = 0 ; k < kount ; k++ ) { for ( size_t k = 0 ; k < kount ; k++ ) {
uint32_t a = byteSwap4(buf, k*size+0, bSwap); uint32_t a = byteSwap4(buf,k*size+0,bSwap);
uint32_t b = byteSwap4(buf, k*size+4, bSwap); uint32_t b = byteSwap4(buf,k*size+4,bSwap);
out << sp << a << "/" << b; out << sp << a << "/" << b;
sp = " "; sp = " ";
} }
@ -466,8 +466,8 @@ namespace Exiv2 {
if ( option == kpsRecursive && (tag == 0x8769 /* ExifTag */ || tag == 0x014a/*SubIFDs*/ || type == tiffIfd) ) { if ( option == kpsRecursive && (tag == 0x8769 /* ExifTag */ || tag == 0x014a/*SubIFDs*/ || type == tiffIfd) ) {
for ( size_t k = 0 ; k < count ; k++ ) { for ( size_t k = 0 ; k < count ; k++ ) {
size_t restore = io.tell(); size_t restore = io.tell();
uint32_t offset = byteSwap4(buf, k*size, bSwap); uint32_t offset = byteSwap4(buf,k*size,bSwap);
printIFDStructure(io, out, option, offset, bSwap,c,depth); printIFDStructure(io,out,option,offset,bSwap,c,depth);
io.seek(restore,BasicIo::beg); io.seek(restore,BasicIo::beg);
} }
} else if ( option == kpsRecursive && tag == 0x83bb /* IPTCNAA */ ) { } else if ( option == kpsRecursive && tag == 0x83bb /* IPTCNAA */ ) {

Loading…
Cancel
Save