commit
4f9d3e4836
@ -89,7 +89,7 @@ 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 -p{S|R} as a file debugging aid
|
||||
*/
|
||||
virtual void printStructure(std::ostream& out, PrintStructureOption option,int depth=-1);
|
||||
virtual void printStructure(std::ostream& out, PrintStructureOption option,int depth=0);
|
||||
|
||||
/*!
|
||||
@brief Not supported. TIFF format does not contain a comment.
|
||||
|
||||
@ -1137,10 +1137,11 @@ namespace Exiv2 {
|
||||
const ExifKey kX("Exif.Photo.PixelXDimension");
|
||||
const ExifKey kY("Exif.Photo.PixelYDimension");
|
||||
const ExifKey kO("Exif.Image.Orientation");
|
||||
const ExifData::const_iterator edX = image.exifData().findKey(kX);
|
||||
const ExifData::const_iterator edY = image.exifData().findKey(kY);
|
||||
const ExifData::const_iterator edO = image.exifData().findKey(kO);
|
||||
const ExifData::const_iterator edEnd = image.exifData().end();
|
||||
const ExifData &exivData = image.exifData();
|
||||
const ExifData::const_iterator edX = exivData.findKey(kX);
|
||||
const ExifData::const_iterator edY = exivData.findKey(kY);
|
||||
const ExifData::const_iterator edO = exivData.findKey(kO);
|
||||
const ExifData::const_iterator edEnd = exivData.end();
|
||||
|
||||
CiffComponent* cc = pHead->findComponent(pCrwMapping->crwTagId_,
|
||||
pCrwMapping->crwDir_);
|
||||
|
||||
@ -147,8 +147,7 @@ namespace Exiv2 {
|
||||
// ISO value (see EXIF 2.3 Annex G)
|
||||
long iso_tmp_val = -1;
|
||||
while (iso_tmp_val == -1 && (iso_val == 65535 || md == ed.end())) {
|
||||
ExifData::const_iterator md_st = ed.end();
|
||||
md_st = findMetadatum(ed, sensitivityType, 1);
|
||||
ExifData::const_iterator md_st = findMetadatum(ed, sensitivityType, 1);
|
||||
// no SensitivityType? exit with existing data
|
||||
if (md_st == ed.end())
|
||||
break;
|
||||
|
||||
@ -704,7 +704,7 @@ namespace {
|
||||
findXmp(posOtherXmp, sizeOtherXmp, data, posOtherXmp + sizeOtherXmp, posEndPageSetup, write);
|
||||
if (posOtherXmp >= posEndPageSetup) break;
|
||||
bool isRemovableEmbedding = false;
|
||||
for (std::vector<std::pair<size_t, size_t> >::const_iterator e = removableEmbeddings.begin(); e != removableEmbeddings.end(); e++) {
|
||||
for (std::vector<std::pair<size_t, size_t> >::const_iterator e = removableEmbeddings.begin(); e != removableEmbeddings.end(); ++e) {
|
||||
if (e->first <= posOtherXmp && posOtherXmp < e->second) {
|
||||
isRemovableEmbedding = true;
|
||||
break;
|
||||
@ -834,7 +834,7 @@ namespace {
|
||||
if (useFlexibleEmbedding) {
|
||||
positions.push_back(xmpPos);
|
||||
}
|
||||
for (std::vector<std::pair<size_t, size_t> >::const_iterator e = removableEmbeddings.begin(); e != removableEmbeddings.end(); e++) {
|
||||
for (std::vector<std::pair<size_t, size_t> >::const_iterator e = removableEmbeddings.begin(); e != removableEmbeddings.end(); ++e) {
|
||||
positions.push_back(e->first);
|
||||
}
|
||||
std::sort(positions.begin(), positions.end());
|
||||
@ -848,7 +848,7 @@ namespace {
|
||||
const uint32_t posEpsNew = posTemp(*tempIo);
|
||||
size_t prevPos = posEps;
|
||||
size_t prevSkipPos = prevPos;
|
||||
for (std::vector<size_t>::const_iterator i = positions.begin(); i != positions.end(); i++) {
|
||||
for (std::vector<size_t>::const_iterator i = positions.begin(); i != positions.end(); ++i) {
|
||||
const size_t pos = *i;
|
||||
if (pos == prevPos) continue;
|
||||
#ifdef DEBUG
|
||||
@ -951,7 +951,7 @@ namespace {
|
||||
}
|
||||
if (!useFlexibleEmbedding) {
|
||||
// remove preceding embedding(s)
|
||||
for (std::vector<std::pair<size_t, size_t> >::const_iterator e = removableEmbeddings.begin(); e != removableEmbeddings.end(); e++) {
|
||||
for (std::vector<std::pair<size_t, size_t> >::const_iterator e = removableEmbeddings.begin(); e != removableEmbeddings.end(); ++e) {
|
||||
if (pos == e->first) {
|
||||
skipPos = e->second;
|
||||
#ifdef DEBUG
|
||||
|
||||
@ -291,7 +291,7 @@ namespace Exiv2 {
|
||||
bool fileExists(const std::string& path, bool ct)
|
||||
{
|
||||
// special case: accept "-" (means stdin)
|
||||
if (path.compare("-") == 0 || fileProtocol(path)) {
|
||||
if (path.compare("-") == 0 || fileProtocol(path) != pFile) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -306,7 +306,7 @@ namespace Exiv2 {
|
||||
bool fileExists(const std::wstring& wpath, bool ct)
|
||||
{
|
||||
// special case: accept "-" (means stdin)
|
||||
if (wpath.compare(L"-") == 0 || fileProtocol(wpath)) {
|
||||
if (wpath.compare(L"-") == 0 || fileProtocol(wpath) != pFile) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -411,12 +411,12 @@ namespace Exiv2 {
|
||||
iterator_t userEnd = std::find(authStart, authEnd, ':');
|
||||
if (userEnd != authEnd) {
|
||||
result.Username = std::string(userStart, userEnd);
|
||||
userEnd++;
|
||||
++userEnd;
|
||||
result.Password = std::string(userEnd, authEnd);
|
||||
} else {
|
||||
result.Username = std::string(authStart, authEnd);
|
||||
}
|
||||
authEnd++;
|
||||
++authEnd;
|
||||
} else {
|
||||
authEnd = protocolEnd;
|
||||
}
|
||||
@ -434,7 +434,7 @@ namespace Exiv2 {
|
||||
// port
|
||||
if ((hostEnd != uriEnd) && ((&*(hostEnd))[0] == ':')) // we have a port
|
||||
{
|
||||
hostEnd++;
|
||||
++hostEnd;
|
||||
iterator_t portEnd = (pathStart != uriEnd) ? pathStart : queryStart;
|
||||
result.Port = std::string(hostEnd, portEnd);
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ static Exiv2::Dictionary stringToDict(const std::string& s)
|
||||
token += s[i];
|
||||
} else {
|
||||
result[token]=token;
|
||||
token="";
|
||||
token.clear();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -842,7 +842,7 @@ namespace Exiv2 {
|
||||
bool bOdd = (i % 2) != 0;
|
||||
bool bEven = !bOdd;
|
||||
pos[i + 1] = bEven ? *it : pos[i] + *it;
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
pos[count + 1] = io_->size() - pos[count];
|
||||
#ifdef DEBUG
|
||||
|
||||
@ -524,22 +524,23 @@ namespace {
|
||||
: Loader(id, image)
|
||||
{
|
||||
offset_ = 0;
|
||||
ExifData::const_iterator pos = image_.exifData().findKey(ExifKey(param_[parIdx].offsetKey_));
|
||||
if (pos != image_.exifData().end() && pos->count() > 0) {
|
||||
const ExifData &exifData = image_.exifData();
|
||||
ExifData::const_iterator pos = exifData.findKey(ExifKey(param_[parIdx].offsetKey_));
|
||||
if (pos != exifData.end() && pos->count() > 0) {
|
||||
offset_ = pos->toLong();
|
||||
}
|
||||
|
||||
size_ = 0;
|
||||
pos = image_.exifData().findKey(ExifKey(param_[parIdx].sizeKey_));
|
||||
if (pos != image_.exifData().end() && pos->count() > 0) {
|
||||
pos = exifData.findKey(ExifKey(param_[parIdx].sizeKey_));
|
||||
if (pos != exifData.end() && pos->count() > 0) {
|
||||
size_ = pos->toLong();
|
||||
}
|
||||
|
||||
if (offset_ == 0 || size_ == 0) return;
|
||||
|
||||
if (param_[parIdx].baseOffsetKey_) {
|
||||
pos = image_.exifData().findKey(ExifKey(param_[parIdx].baseOffsetKey_));
|
||||
if (pos != image_.exifData().end() && pos->count() > 0) {
|
||||
pos = exifData.findKey(ExifKey(param_[parIdx].baseOffsetKey_));
|
||||
if (pos != exifData.end() && pos->count() > 0) {
|
||||
offset_ += pos->toLong();
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,11 +101,11 @@ namespace Exiv2 {
|
||||
if (io_->error() || io_->eof()) throw Error(kerFailedToReadImageData);
|
||||
throw Error(kerNotAnImage, "RAF");
|
||||
}
|
||||
bool bPrint = option==kpsBasic || option==kpsRecursive;
|
||||
const bool bPrint = option==kpsBasic || option==kpsRecursive;
|
||||
if ( bPrint ) {
|
||||
io_->seek(0,BasicIo::beg); // rewind
|
||||
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< "STRUCTURE OF RAF FILE: "
|
||||
<< io().path()
|
||||
@ -118,7 +118,7 @@ namespace Exiv2 {
|
||||
byte magicdata [17];
|
||||
io_->read(magicdata, 16);
|
||||
magicdata[16] = 0;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 16, 0)
|
||||
<< "Magic number : "
|
||||
@ -129,7 +129,7 @@ namespace Exiv2 {
|
||||
byte data1 [5];
|
||||
io_->read(data1, 4);
|
||||
data1[4] = 0;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 4, 16)
|
||||
<< "data 1 : "
|
||||
@ -140,7 +140,7 @@ namespace Exiv2 {
|
||||
byte data2 [9];
|
||||
io_->read(data2, 8);
|
||||
data2[8] = 0;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 8, 20)
|
||||
<< "data 2 : "
|
||||
@ -151,7 +151,7 @@ namespace Exiv2 {
|
||||
byte camdata [33];
|
||||
io_->read(camdata, 32);
|
||||
camdata[32] = 0;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 32, 28)
|
||||
<< "camera : "
|
||||
@ -162,7 +162,7 @@ namespace Exiv2 {
|
||||
byte dir_version [5];
|
||||
io_->read(dir_version, 4);
|
||||
dir_version[4] = 0;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 4, 60)
|
||||
<< "dir version : "
|
||||
@ -183,7 +183,7 @@ namespace Exiv2 {
|
||||
std::stringstream j_len;
|
||||
j_off << jpg_img_off;
|
||||
j_len << jpg_img_len;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 4, 84)
|
||||
<< "JPEG Image Offset : "
|
||||
@ -206,7 +206,7 @@ namespace Exiv2 {
|
||||
std::stringstream ch_len;
|
||||
ch_off << cfa_hdr_off;
|
||||
ch_len << cfa_hdr_len;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 4, 92)
|
||||
<< "CFA Header Offset : "
|
||||
@ -229,7 +229,7 @@ namespace Exiv2 {
|
||||
std::stringstream c_len;
|
||||
c_off << cfa_off;
|
||||
c_len << cfa_len;
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", 4, 100)
|
||||
<< "CFA Offset : "
|
||||
@ -245,7 +245,7 @@ namespace Exiv2 {
|
||||
io_->seek(jpg_img_off, BasicIo::beg); // rewind
|
||||
DataBuf payload(16); // header is different from chunks
|
||||
io_->read(payload.pData_, payload.size_);
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", jpg_img_len, jpg_img_off)
|
||||
<< "jpg image / exif : "
|
||||
@ -255,7 +255,7 @@ namespace Exiv2 {
|
||||
|
||||
io_->seek(cfa_hdr_off, BasicIo::beg); // rewind
|
||||
io_->read(payload.pData_, payload.size_);
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", cfa_hdr_len, cfa_hdr_off)
|
||||
<< "CFA Header: "
|
||||
@ -265,7 +265,7 @@ namespace Exiv2 {
|
||||
|
||||
io_->seek(cfa_off, BasicIo::beg); // rewind
|
||||
io_->read(payload.pData_, payload.size_);
|
||||
if ( bPrint ) {
|
||||
{
|
||||
out << Internal::indent(depth)
|
||||
<< Internal::stringFormat(" %8u | %8u | ", cfa_len, cfa_off)
|
||||
<< "CFA : "
|
||||
|
||||
@ -184,7 +184,7 @@ namespace Exiv2 {
|
||||
// recursively print the structure to /dev/null to ensure all metadata is in memory
|
||||
// must be recursive to handle NEFs which stores the raw image in a subIFDs
|
||||
std::ofstream devnull;
|
||||
printStructure(devnull,kpsRecursive,0);
|
||||
printStructure(devnull,kpsRecursive);
|
||||
ByteOrder bo = TiffParser::decode(exifData_,
|
||||
iptcData_,
|
||||
xmpData_,
|
||||
|
||||
@ -905,7 +905,7 @@ namespace Exiv2 {
|
||||
#endif
|
||||
DataBuf buf = object->pValue()->dataArea();
|
||||
memcpy(object->pDataArea_, buf.pData_, buf.size_);
|
||||
if (object->sizeDataArea_ - buf.size_ > 0) {
|
||||
if (object->sizeDataArea_ > static_cast<uint32_t>(buf.size_)) {
|
||||
memset(object->pDataArea_ + buf.size_,
|
||||
0x0, object->sizeDataArea_ - buf.size_);
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
|
||||
output(os,keys,"curl" , use_curl);
|
||||
if ( libs.begin() != libs.end() ) {
|
||||
output(os,keys,"executable" ,*libs.begin());
|
||||
for ( Exiv2::StringVector_i lib = libs.begin()+1 ; lib != libs.end() ; lib++ )
|
||||
for ( Exiv2::StringVector_i lib = libs.begin()+1 ; lib != libs.end() ; ++lib )
|
||||
output(os,keys,"library",*lib);
|
||||
}
|
||||
|
||||
@ -530,7 +530,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
|
||||
|
||||
Exiv2::Dictionary ns;
|
||||
Exiv2::XmpProperties::registeredNamespaces(ns);
|
||||
for ( Exiv2::Dictionary_i it = ns.begin(); it != ns.end() ; it++ ) {
|
||||
for ( Exiv2::Dictionary_i it = ns.begin(); it != ns.end() ; ++it ) {
|
||||
std::string xmlns = (*it).first;
|
||||
std::string uri = (*it).second;
|
||||
output(os,keys,name,xmlns+":"+uri);
|
||||
|
||||
@ -131,7 +131,7 @@ namespace Exiv2 {
|
||||
copyIptcToXmp(iptcData_, xmpData_);
|
||||
|
||||
// #1112 - restore dates if they lost their TZ info
|
||||
for ( Exiv2::Dictionary_i it = dates_.begin() ; it != dates_.end() ; it++) {
|
||||
for ( Exiv2::Dictionary_i it = dates_.begin() ; it != dates_.end() ; ++it ) {
|
||||
std::string sKey = it->first;
|
||||
Exiv2::XmpKey key(sKey);
|
||||
if ( xmpData_.findKey(key) != xmpData_.end() ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user