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)
17. [Building with C++11 and other compilers](#2-17)
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)
1. [License](#3-1)
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">
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_.**

@ -7,7 +7,7 @@ if (${EXIV2_ENABLE_WEBREADY})
set(EXV_USE_SSH ${EXIV2_ENABLE_SSH})
set(EXV_USE_CURL ${EXIV2_ENABLE_CURL})
endif()
set(EXV_ENABLE_BMFF ${EXIV2_ENABLE_BMFF})
set(EXV_ENABLE_BMFF ${EXIV2_ENABLE_BMFF})
set(EXV_ENABLE_VIDEO ${EXIV2_ENABLE_VIDEO})
set(EXV_ENABLE_WEBREADY ${EXIV2_ENABLE_WEBREADY})
set(EXV_HAVE_LENSDATA ${EXIV2_ENABLE_LENSDATA})

@ -72,4 +72,4 @@
#include "exiv2/xmp_exiv2.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 - -
EXV Read/Write Read/Write Read/Write Read/Write Read/Write
GIF - - - - -
HEIC Read Read Read - -
HEIF Read Read Read - -
JP2 Read/Write Read/Write Read/Write - Read/Write
JPEG Read/Write Read/Write Read/Write Read/Write Read/Write

@ -31,17 +31,17 @@
#include "safe_op.hpp"
#include "slice.hpp"
#ifdef EXV_ENABLE_BMFF
#ifdef EXV_ENABLE_BMFF
#include "bmffimage.hpp"
#endif // EXV_ENABLE_BMFF
#endif// EXV_ENABLE_BMFF
#include "cr2image.hpp"
#include "crwimage.hpp"
#include "epsimage.hpp"
#include "jpgimage.hpp"
#include "mrwimage.hpp"
#ifdef EXV_HAVE_LIBZ
#ifdef EXV_HAVE_LIBZ
# include "pngimage.hpp"
#endif // EXV_HAVE_LIBZ
#endif// EXV_HAVE_LIBZ
#include "rafimage.hpp"
#include "tiffimage.hpp"
#include "tiffimage_int.hpp"
@ -56,12 +56,12 @@
#include "jp2image.hpp"
#include "nikonmn_int.hpp"
#ifdef EXV_ENABLE_VIDEO
#ifdef EXV_ENABLE_VIDEO
#include "matroskavideo.hpp"
#include "quicktimevideo.hpp"
#include "riffvideo.hpp"
#include "asfvideo.hpp"
#endif // EXV_ENABLE_VIDEO
#endif// EXV_ENABLE_VIDEO
#include "rw2image.hpp"
#include "pgfimage.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());
}
@ -248,7 +248,7 @@ namespace Exiv2 {
}
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;
byte* source_value = reinterpret_cast<byte *>(&value);
@ -260,7 +260,7 @@ namespace Exiv2 {
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;
result |= (value & 0x000000FF) << 24;
@ -270,7 +270,7 @@ namespace Exiv2 {
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;
result |= (value & 0x00FF) << 8;
@ -278,16 +278,16 @@ namespace Exiv2 {
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;
char* p = (char*) &v;
p[0] = buf.pData_[offset];
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;
char* p = (char*) &v;
@ -295,10 +295,10 @@ namespace Exiv2 {
p[1] = buf.pData_[offset+1];
p[2] = buf.pData_[offset+2];
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;
byte* p = reinterpret_cast<byte *>(&v);
@ -306,7 +306,7 @@ namespace Exiv2 {
for(int i = 0; i < 8; 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
@ -338,7 +338,7 @@ namespace Exiv2 {
}
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++;
if ( depth == 1 ) visits.clear();
@ -351,18 +351,18 @@ namespace Exiv2 {
do {
// 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);
if (!seekSuccess || bytesRead == 0) {
throw Error(kerCorruptedMetadata);
}
uint16_t dirLength = byteSwap2(dir, 0, bSwap);
uint16_t dirLength = byteSwap2(dir,0,bSwap);
bool tooBig = dirLength > 500;
if ( tooBig ) throw Error(kerTiffDirectoryTooLarge);
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;
}
@ -381,10 +381,10 @@ namespace Exiv2 {
bFirst = false;
io.read(dir.pData_, 12);
uint16_t tag = byteSwap2(dir, 0, bSwap);
uint16_t type = byteSwap2(dir, 2, bSwap);
uint32_t count = byteSwap4(dir, 4, bSwap);
uint32_t offset = byteSwap4(dir, 8, bSwap);
uint16_t tag = byteSwap2(dir,0,bSwap);
uint16_t type = byteSwap2(dir,2,bSwap);
uint32_t count = byteSwap4(dir,4,bSwap);
uint32_t offset = byteSwap4(dir,8,bSwap);
// Break for unknown tag types else we may segfault.
if ( !typeValid(type) ) {
@ -396,10 +396,10 @@ namespace Exiv2 {
std::string sp = "" ; // output spacer
//prepare to print the value
uint32_t kount = isPrintXMP(tag, option) ? count // haul in all the data
: isPrintICC(tag, option) ? count // ditto
: isStringType(type) ? (count > 32 ? 32 : count) // restrict long arrays
: count > 5 ? 5
uint32_t kount = isPrintXMP(tag,option) ? count // haul in all the data
: isPrintICC(tag,option) ? count // ditto
: isStringType(type) ? (count > 32 ? 32 : count) // restrict long arrays
: count > 5 ? 5
: count
;
uint32_t pad = isStringType(type) ? 1 : 0;
@ -419,14 +419,14 @@ namespace Exiv2 {
}
DataBuf buf((long)allocate); // allocate a buffer
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;
if ( bOffsetIsPointer ) { // read into buffer
size_t restore = io.tell(); // save
io.seek(offset, BasicIo::beg); // position
io.read(buf.pData_, count*size);// read
io.seek(restore,BasicIo::beg); // restore
if ( bOffsetIsPointer ) { // read into buffer
size_t restore = io.tell(); // save
io.seek(offset,BasicIo::beg); // position
io.read(buf.pData_,count*size);// read
io.seek(restore,BasicIo::beg); // restore
}
if ( bPrint ) {
@ -436,23 +436,23 @@ namespace Exiv2 {
"";
out << Internal::indent(depth)
<< Internal::stringFormat("%8u | %#06x %-28s |%10s |%9u |%10s | ",
address, tag, tagName(tag).c_str(), typeName(type), count, offsetString.c_str());
<< Internal::stringFormat("%8u | %#06x %-28s |%10s |%9u |%10s | "
,address,tag,tagName(tag).c_str(),typeName(type),count,offsetString.c_str());
if ( isShortType(type) ){
for ( size_t k = 0 ; k < kount ; k++ ) {
out << sp << byteSwap2(buf, k*size, bSwap);
out << sp << byteSwap2(buf,k*size,bSwap);
sp = " ";
}
} else if ( isLongType(type) ){
for ( size_t k = 0 ; k < kount ; k++ ) {
out << sp << byteSwap4(buf, k*size, bSwap);
out << sp << byteSwap4(buf,k*size,bSwap);
sp = " ";
}
} else if ( isRationalType(type) ){
for ( size_t k = 0 ; k < kount ; k++ ) {
uint32_t a = byteSwap4(buf, k*size+0, bSwap);
uint32_t b = byteSwap4(buf, k*size+4, bSwap);
uint32_t a = byteSwap4(buf,k*size+0,bSwap);
uint32_t b = byteSwap4(buf,k*size+4,bSwap);
out << sp << a << "/" << b;
sp = " ";
}
@ -466,8 +466,8 @@ namespace Exiv2 {
if ( option == kpsRecursive && (tag == 0x8769 /* ExifTag */ || tag == 0x014a/*SubIFDs*/ || type == tiffIfd) ) {
for ( size_t k = 0 ; k < count ; k++ ) {
size_t restore = io.tell();
uint32_t offset = byteSwap4(buf, k*size, bSwap);
printIFDStructure(io, out, option, offset, bSwap,c,depth);
uint32_t offset = byteSwap4(buf,k*size,bSwap);
printIFDStructure(io,out,option,offset,bSwap,c,depth);
io.seek(restore,BasicIo::beg);
}
} else if ( option == kpsRecursive && tag == 0x83bb /* IPTCNAA */ ) {

Loading…
Cancel
Save