Commit d6cba62d authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

polish coding style. no BC is broken there.

wrap Sony makernote tags to preprocessor rules to prevent exception from old Exiv2 version

svn path=/trunk/KDE/kdegraphics/libs/libkexiv2/; revision=1125330
parent 26f29c2d
......@@ -272,7 +272,7 @@ bool KExiv2::loadFromData(const QByteArray& imgData) const
return true;
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
d->printExiv2ExceptionError("Cannot load metadata using Exiv2 ", e);
}
......@@ -321,7 +321,7 @@ bool KExiv2::load(const QString& filePath) const
return true;
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
d->printExiv2ExceptionError("Cannot load metadata using Exiv2 ", e);
}
......@@ -509,7 +509,7 @@ bool KExiv2::save(const QString& filePath) const
return true;
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
d->printExiv2ExceptionError("Cannot save metadata using Exiv2 ", e);
}
......
......@@ -6,8 +6,8 @@
* Date : 2006-09-15
* Description : Exiv2 library interface for KDE
*
* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2006-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* Exiv2: http://www.exiv2.org
* Exif : http://www.exif.org/Exif2-2.PDF
......@@ -342,7 +342,7 @@ public:
header. Header is saved into 'lang'. If no language alternative is founf, value is returned
as well and 'lang' is set to a null string.
*/
static QString detectLanguageAlt(const QString &value, QString& lang);
static QString detectLanguageAlt(const QString& value, QString& lang);
//-----------------------------------------------------------------
//-- EXIF manipulation methods ------------------------------------
......@@ -392,7 +392,7 @@ public:
/** Fix orientation of a QImage image accordingly with Exif orientation tag.
Return true if image is rotated, else false.
*/
bool rotateExifQImage(QImage &image, ImageOrientation orientation) const;
bool rotateExifQImage(QImage& image, ImageOrientation orientation) const;
/** Set the Exif Thumbnail image. The thumbnail image must have the right dimensions before.
Look Exif specification for details. Return true if thumbnail have been changed in metadata.
......@@ -418,11 +418,11 @@ public:
/** Get an Exif tags content like a string. If 'escapeCR' parameter is true, the CR characters
will be removed. If Exif tag cannot be found a null string is returned.
*/
QString getExifTagString(const char *exifTagName, bool escapeCR=true) const;
QString getExifTagString(const char* exifTagName, bool escapeCR=true) const;
/** Set an Exif tag content using a string. Return true if tag is set successfully.
*/
bool setExifTagString(const char *exifTagName, const QString& value, bool setProgramName=true) const;
bool setExifTagString(const char* exifTagName, const QString& value, bool setProgramName=true) const;
/** Get an Exif tag content like a long value. Return true if Exif tag be found.
*/
......@@ -430,28 +430,28 @@ public:
/** Set an Exif tag content using a long value. Return true if tag is set successfully.
*/
bool setExifTagLong(const char *exifTagName, long val, bool setProgramName=true) const;
bool setExifTagLong(const char* exifTagName, long val, bool setProgramName=true) const;
/** Get the 'component' index of an Exif tags content like a rational value.
'num' and 'den' are the numerator and the denominator of the rational value.
Return true if Exif tag be found.
*/
bool getExifTagRational(const char *exifTagName, long int &num, long int &den, int component=0) const;
bool getExifTagRational(const char* exifTagName, long int& num, long int& den, int component=0) const;
/** Set an Exif tag content using a rational value.
'num' and 'den' are the numerator and the denominator of the rational value.
Return true if tag is set successfully.
*/
bool setExifTagRational(const char *exifTagName, long int num, long int den, bool setProgramName=true) const;
bool setExifTagRational(const char* exifTagName, long int num, long int den, bool setProgramName=true) const;
/** Get an Exif tag content like a bytes array. Return an empty bytes array if Exif
tag cannot be found.
*/
QByteArray getExifTagData(const char *exifTagName) const;
QByteArray getExifTagData(const char* exifTagName) const;
/** Set an Exif tag content using a bytes array. Return true if tag is set successfully.
*/
bool setExifTagData(const char *exifTagName, const QByteArray& data, bool setProgramName=true) const;
bool setExifTagData(const char* exifTagName, const QByteArray& data, bool setProgramName=true) const;
/** Get an Exif tags content as a QVariant. Returns a null QVariant if the Exif
tag cannot be found.
......@@ -461,7 +461,7 @@ public:
if rationalAsListOfInts is true, as double if rationalAsListOfInts is false.
An exif tag of numerical type may contain more than one value; set component to the desired index.
*/
QVariant getExifTagVariant(const char *exifTagName, bool rationalAsListOfInts=true, bool escapeCR=true, int component=0) const;
QVariant getExifTagVariant(const char* exifTagName, bool rationalAsListOfInts=true, bool escapeCR=true, int component=0) const;
/** Set an Exif tag content using a QVariant. Returns true if tag is set successfully.
All types described for the above method are supported.
......@@ -469,28 +469,28 @@ public:
For the meaning of rationalWantSmallDenominator, see the documentation of the convertToRational methods.
Setting a value with multiple components is currently not supported.
*/
bool setExifTagVariant(const char *exifTagName, const QVariant& data,
bool setExifTagVariant(const char* exifTagName, const QVariant& data,
bool rationalWantSmallDenominator=true, bool setProgramName=true) const;
/** Remove the Exif tag 'exifTagName' from Exif metadata. Return true if tag is
removed successfully or if no tag was present.
*/
bool removeExifTag(const char *exifTagName, bool setProgramName=true) const;
bool removeExifTag(const char* exifTagName, bool setProgramName=true) const;
/** Return the Exif Tag title or a null string.
*/
QString getExifTagTitle(const char *exifTagName);
QString getExifTagTitle(const char* exifTagName);
/** Return the Exif Tag description or a null string.
*/
QString getExifTagDescription(const char *exifTagName);
QString getExifTagDescription(const char* exifTagName);
/** Takes a QVariant value as it could have been retrieved by getExifTagVariant with the given exifTagName,
and returns its value properly converted to a string (including i18n).
This is equivalent to calling getExifTagString directly.
If escapeCR is true CR characters will be removed from the result.
*/
QString createExifUserStringFromValue(const char *exifTagName, const QVariant &val, bool escapeCR=true);
QString createExifUserStringFromValue(const char* exifTagName, const QVariant& val, bool escapeCR=true);
/** Return a map of Exif tags name/value found in metadata sorted by
Exif keys given by 'exifKeysFilter'.
......@@ -510,7 +510,7 @@ public:
- not include "Iop", or "Thumbnail", or "Image", or "Photo" in the Exif tag keys
if 'inverSelection' is true.
*/
KExiv2::MetaDataMap getExifTagsDataList(const QStringList &exifKeysFilter, bool invertSelection=false) const;
KExiv2::MetaDataMap getExifTagsDataList(const QStringList& exifKeysFilter, bool invertSelection=false) const;
//-------------------------------------------------------------
//-- IPTC manipulation methods --------------------------------
......@@ -550,7 +550,7 @@ public:
/** Set an Iptc tag content using a string. Return true if tag is set successfully.
*/
bool setIptcTagString(const char *iptcTagName, const QString& value, bool setProgramName=true) const;
bool setIptcTagString(const char* iptcTagName, const QString& value, bool setProgramName=true) const;
/** Returns a strings list with of multiple Iptc tags from the image. Return an empty list if no tag is found. */
/** Get the values of all IPTC tags with the given tag name in a string list.
......@@ -571,24 +571,24 @@ public:
/** Get an Iptc tag content as a bytes array. Return an empty bytes array if Iptc
tag cannot be found.
*/
QByteArray getIptcTagData(const char *iptcTagName) const;
QByteArray getIptcTagData(const char* iptcTagName) const;
/** Set an Iptc tag content using a bytes array. Return true if tag is set successfully.
*/
bool setIptcTagData(const char *iptcTagName, const QByteArray& data, bool setProgramName=true) const;
bool setIptcTagData(const char* iptcTagName, const QByteArray& data, bool setProgramName=true) const;
/** Remove the all instance of Iptc tags 'iptcTagName' from Iptc metadata. Return true if all
tags have been removed successfully (or none were present).
*/
bool removeIptcTag(const char *iptcTagName, bool setProgramName=true) const;
bool removeIptcTag(const char* iptcTagName, bool setProgramName=true) const;
/** Return the Iptc Tag title or a null string.
*/
QString getIptcTagTitle(const char *iptcTagName);
QString getIptcTagTitle(const char* iptcTagName);
/** Return the Iptc Tag description or a null string.
*/
QString getIptcTagDescription(const char *iptcTagName);
QString getIptcTagDescription(const char* iptcTagName);
/** Return a map of Iptc tags name/value found in metadata sorted by
Iptc keys given by 'iptcKeysFilter'.
......@@ -606,7 +606,7 @@ public:
- not include "Envelope", or "Application2" in the Iptc tag keys
if 'inverSelection' is true.
*/
KExiv2::MetaDataMap getIptcTagsDataList(const QStringList &iptcKeysFilter, bool invertSelection=false) const;
KExiv2::MetaDataMap getIptcTagsDataList(const QStringList& iptcKeysFilter, bool invertSelection=false) const;
/** Return a strings list of Iptc keywords from image. Return an empty list if no keyword are set.
*/
......@@ -682,15 +682,15 @@ public:
/** Set a Xmp tag content using a string. Return true if tag is set successfully.
*/
bool setXmpTagString(const char *xmpTagName, const QString& value, bool setProgramName=true) const;
bool setXmpTagString(const char* xmpTagName, const QString& value, bool setProgramName=true) const;
/** Return the Xmp Tag title or a null string.
*/
QString getXmpTagTitle(const char *xmpTagName);
QString getXmpTagTitle(const char* xmpTagName);
/** Return the Xmp Tag description or a null string.
*/
QString getXmpTagDescription(const char *xmpTagName);
QString getXmpTagDescription(const char* xmpTagName);
/** Return a map of Xmp tags name/value found in metadata sorted by
Xmp keys given by 'xmpKeysFilter'.
......@@ -708,7 +708,7 @@ public:
- not include "dc", or "xmp" in the Xmp tag keys
if 'inverSelection' is true.
*/
KExiv2::MetaDataMap getXmpTagsDataList(const QStringList &xmpKeysFilter, bool invertSelection=false) const;
KExiv2::MetaDataMap getXmpTagsDataList(const QStringList& xmpKeysFilter, bool invertSelection=false) const;
/** Get all redondant Alternative Language Xmp tags content like a map.
See AltLangMap class description for details.
......@@ -721,7 +721,7 @@ public:
description for details. If tag already exist, it wil be removed before.
Return true if tag is set successfully.
*/
bool setXmpTagStringListLangAlt(const char *xmpTagName, const KExiv2::AltLangMap& values,
bool setXmpTagStringListLangAlt(const char* xmpTagName, const KExiv2::AltLangMap& values,
bool setProgramName) const;
/** Get a Xmp tag content like a string set with an alternative language
......@@ -736,7 +736,7 @@ public:
set alternative language to default settings ("x-default").
Return true if tag is set successfully.
*/
bool setXmpTagStringLangAlt(const char *xmpTagName, const QString& value,
bool setXmpTagStringLangAlt(const char* xmpTagName, const QString& value,
const QString& langAlt, bool setProgramName=true) const;
/** Get a Xmp tag content like a sequence of strings. If 'escapeCR' parameter is true, the CR characters
......@@ -747,7 +747,7 @@ public:
/** Set a Xmp tag content using the sequence of strings 'seq'.
Return true if tag is set successfully.
*/
bool setXmpTagStringSeq(const char *xmpTagName, const QStringList& seq,
bool setXmpTagStringSeq(const char* xmpTagName, const QStringList& seq,
bool setProgramName=true) const;
/** Get a Xmp tag content like a bag of strings. If 'escapeCR' parameter is true, the CR characters
......@@ -758,7 +758,7 @@ public:
/** Set a Xmp tag content using the bag of strings 'bag'.
Return true if tag is set successfully.
*/
bool setXmpTagStringBag(const char *xmpTagName, const QStringList& bag,
bool setXmpTagStringBag(const char* xmpTagName, const QStringList& bag,
bool setProgramName=true) const;
/** Set an Xmp tag content using a list of strings defined by the 'entriesToAdd' parameter.
......@@ -766,14 +766,14 @@ public:
all new with all already existing entries to prevent duplicates in the image.
Return true if the entries have been added to metadata.
*/
bool addToXmpTagStringBag(const char *xmpTagName, const QStringList& entriesToAdd,
bool addToXmpTagStringBag(const char* xmpTagName, const QStringList& entriesToAdd,
bool setProgramName) const;
/** Remove those Xmp tag entries that are listed in entriesToRemove from the entries in metadata.
Return true if tag entries are no longer contained in metadata.
All other entries are preserved.
*/
bool removeFromXmpTagStringBag(const char *xmpTagName, const QStringList& entriesToRemove,
bool removeFromXmpTagStringBag(const char* xmpTagName, const QStringList& entriesToRemove,
bool setProgramName) const;
/** Get an Xmp tag content as a QVariant. Returns a null QVariant if the Xmp
......@@ -786,7 +786,7 @@ public:
LangAlt values will have type Map (QMap<QString, QVariant>) with the language
code as key and the contents as value, of type String.
*/
QVariant getXmpTagVariant(const char *xmpTagName, bool rationalAsListOfInts=true, bool stringEscapeCR=true) const;
QVariant getXmpTagVariant(const char* xmpTagName, bool rationalAsListOfInts=true, bool stringEscapeCR=true) const;
/** Return a strings list of Xmp keywords from image. Return an empty list if no keyword are set.
*/
......@@ -840,7 +840,7 @@ public:
/** Remove the Xmp tag 'xmpTagName' from Xmp metadata. Return true if tag is
removed successfully or if no tag was present.
*/
bool removeXmpTag(const char *xmpTagName, bool setProgramName=true) const;
bool removeXmpTag(const char* xmpTagName, bool setProgramName=true) const;
/** Register a namespace which Exiv2 doesn't know yet. This is only needed
......@@ -872,12 +872,12 @@ public:
where the sign determines the direction ref (North + / South - ; East + / West -).
Returns true if the information is available.
*/
bool getGPSLatitudeNumber(double *latitude) const;
bool getGPSLongitudeNumber(double *longitude) const;
bool getGPSLatitudeNumber(double* latitude) const;
bool getGPSLongitudeNumber(double* longitude) const;
/** Get GPS altitude information, in meters, relative to sea level (positive sign above sea level)
*/
bool getGPSAltitude(double *altitude) const;
bool getGPSAltitude(double* altitude) const;
/** Set all GPS location information into image. Return true if all information have been
changed in metadata.
......@@ -928,23 +928,23 @@ public:
Returns true if the conversion was successful.
If minutes is given in the fractional form, a denominator of 1000000 for the minutes will be used.
*/
static bool convertFromGPSCoordinateString(const QString &coordinate,
long int *numeratorDegrees, long int *denominatorDegrees,
long int *numeratorMinutes, long int *denominatorMinutes,
long int *numeratorSeconds, long int *denominatorSeconds,
char *directionReference);
static bool convertFromGPSCoordinateString(const QString& coordinate,
long int* numeratorDegrees, long int* denominatorDegrees,
long int* numeratorMinutes, long int* denominatorMinutes,
long int* numeratorSeconds, long int* denominatorSeconds,
char* directionReference);
/** Convert a GPSCoordinate string as defined by XMP to a double floating point number in degrees
where the sign determines the direction ref (North + / South - ; East + / West -).
Returns true if the conversion was successful.
*/
static bool convertFromGPSCoordinateString(const QString &gpsString, double *coordinate);
static bool convertFromGPSCoordinateString(const QString& gpsString, double* coordinate);
/** Converts a GPSCoordinate string to user presentable numbers, integer degrees and minutes and
double floating point seconds, and a direction reference ('N' or 'S', 'E' or 'W')
*/
static bool convertToUserPresentableNumbers(const QString &coordinate,
int *degrees, int *minutes, double *seconds, char *directionReference);
static bool convertToUserPresentableNumbers(const QString& coordinate,
int* degrees, int* minutes, double* seconds, char* directionReference);
/** Converts a double floating point number to user presentable numbers, integer degrees and minutes and
double floating point seconds, and a direction reference ('N' or 'S', 'E' or 'W').
......@@ -952,7 +952,7 @@ public:
if the latitude or the longitude is meant by the double parameter.
*/
static void convertToUserPresentableNumbers(bool isLatitude, double coordinate,
int *degrees, int *minutes, double *seconds, char *directionReference);
int* degrees, int* minutes, double* seconds, char* directionReference);
protected:
......
......@@ -6,8 +6,8 @@
* Date : 2007-09-03
* Description : Exiv2 library interface for KDE
*
* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2006-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -54,7 +54,7 @@ void KExiv2Priv::printExiv2ExceptionError(const QString& msg, Exiv2::Error& e)
<< e.code() << ": " << s.c_str() << endl;
}
QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum& exifDatum)
{
try
{
......@@ -93,16 +93,16 @@ QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
if (charset == "\"Unicode\"")
{
#if (EXIV2_TEST_VERSION(0,20,0))
#if (EXIV2_TEST_VERSION(0,20,0))
return QString::fromUtf8(comment.data());
#else
#else
// Older versions give a UCS2-String, see bug #205824
// QString expects a null-terminated UCS-2 string.
// Is it already null terminated? In any case, add termination "\0\0" for safety.
comment.resize(comment.length() + 2, '\0');
return QString::fromUtf16((unsigned short *)comment.data());
#endif
#endif
}
else if (charset == "\"Jis\"")
{
......@@ -118,7 +118,7 @@ QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
return detectEncodingAndDecode(comment);
}
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
printExiv2ExceptionError("Cannot convert Comment using Exiv2 ", e);
}
......@@ -126,7 +126,7 @@ QString KExiv2Priv::convertCommentValue(const Exiv2::Exifdatum &exifDatum)
return QString();
}
QString KExiv2Priv::detectEncodingAndDecode(const std::string &value)
QString KExiv2Priv::detectEncodingAndDecode(const std::string& value)
{
// For charset autodetection, we could use sophisticated code
// (Mozilla chardet, KHTML's autodetection, QTextCodec::codecForContent),
......
......@@ -6,8 +6,8 @@
* Date : 2007-09-03
* Description : Exiv2 library interface for KDE
*
* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2006-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -151,37 +151,38 @@ public:
/** Wrapper method to convert a Comments content to a QString.
*/
QString convertCommentValue(const Exiv2::Exifdatum &exifDatum);
QString convertCommentValue(const Exiv2::Exifdatum& exifDatum);
/** Charset autodetection to convert a string to a QString.
*/
QString detectEncodingAndDecode(const std::string &value);
QString detectEncodingAndDecode(const std::string& value);
/**
*/
int getXMPTagsListFromPrefix(const QString& pf, KExiv2::TagsMap& tagsMap);
const Exiv2::ExifData& exifMetadata() const { return data.constData()->exifMetadata; }
const Exiv2::IptcData& iptcMetadata() const { return data.constData()->iptcMetadata; }
const Exiv2::XmpData& xmpMetadata() const { return data.constData()->xmpMetadata; }
const Exiv2::ExifData& exifMetadata() const { return data.constData()->exifMetadata; }
const Exiv2::IptcData& iptcMetadata() const { return data.constData()->iptcMetadata; }
const Exiv2::XmpData& xmpMetadata() const { return data.constData()->xmpMetadata; }
const std::string& imageComments() const { return data.constData()->imageComments; }
Exiv2::ExifData& exifMetadata() { return data.data()->exifMetadata; }
Exiv2::IptcData& iptcMetadata() { return data.data()->iptcMetadata; }
Exiv2::XmpData& xmpMetadata() { return data.data()->xmpMetadata; }
Exiv2::ExifData& exifMetadata() { return data.data()->exifMetadata; }
Exiv2::IptcData& iptcMetadata() { return data.data()->iptcMetadata; }
Exiv2::XmpData& xmpMetadata() { return data.data()->xmpMetadata; }
std::string& imageComments() { return data.data()->imageComments; }
public:
bool writeRawFiles;
bool updateFileTimeStamp;
bool writeRawFiles;
bool updateFileTimeStamp;
QString filePath;
QSize pixelSize;
QString mimeType;
QString filePath;
QSize pixelSize;
QString mimeType;
QSharedDataPointer<KExiv2DataPriv> data;
};
} // NameSpace KExiv2Iface
#endif
#endif // KEXIV2PRIVATE_H
......@@ -7,8 +7,8 @@
* Description : Exiv2 library interface for KDE
* Comments manipulation methods
*
* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2006-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -40,7 +40,7 @@ bool KExiv2::canWriteComment(const QString& filePath)
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdComment);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
std::string s(e.what());
kDebug(51003) << "Cannot check Comment access mode using Exiv2 (Error #"
......@@ -76,7 +76,7 @@ bool KExiv2::setComments(const QByteArray& data) const
return true;
}
QString KExiv2::detectLanguageAlt(const QString &value, QString& lang)
QString KExiv2::detectLanguageAlt(const QString& value, QString& lang)
{
// Ex. from an Xmp tag Xmp.tiff.copyright: "lang="x-default" (c) Gilles Caulier 2007"
......
......@@ -6,7 +6,7 @@
* Date : 2009-11-15
* Description : Exiv2 library interface for KDE
*
* Copyright (C) 2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2009-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......
......@@ -7,8 +7,8 @@
* Description : Exiv2 library interface for KDE
* Exif manipulation methods
*
* Copyright (C) 2006-2009 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
* Copyright (C) 2006-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
* Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
......@@ -44,7 +44,7 @@ bool KExiv2::canWriteExif(const QString& filePath)
Exiv2::AccessMode mode = image->checkMode(Exiv2::mdExif);
return (mode == Exiv2::amWrite || mode == Exiv2::amReadWrite);
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
std::string s(e.what());
kDebug(51003) << "Cannot check Exif access mode using Exiv2 (Error #"
......@@ -66,7 +66,7 @@ bool KExiv2::clearExif() const
d->exifMetadata().clear();
return true;
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
d->printExiv2ExceptionError("Cannot clear Exif data using Exiv2 ", e);
}
......@@ -109,7 +109,7 @@ QByteArray KExiv2::getExifEncoded(bool addExifHeader) const
return data;
}
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
if (!d->filePath.isEmpty())
kDebug(51003) << "From file " << d->filePath.toAscii().constData() << endl;
......@@ -137,7 +137,7 @@ bool KExiv2::setExif(const QByteArray& data) const
#endif
}
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
if (!d->filePath.isEmpty())
kDebug(51003) << "From file " << d->filePath.toAscii().constData() << endl;
......@@ -229,7 +229,7 @@ QString KExiv2::getExifComment() const
}
}
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
d->printExiv2ExceptionError("Cannot find Exif User Comment using Exiv2 ", e);
}
......@@ -261,11 +261,11 @@ bool KExiv2::setExifComment(const QString& comment, bool setProgramName) const
{
// write as Unicode (UCS-2)
#if (EXIV2_TEST_VERSION(0,20,0))
#if (EXIV2_TEST_VERSION(0,20,0))
std::string exifComment("charset=\"Unicode\" ");
exifComment += comment.toUtf8().constData();
d->exifMetadata()["Exif.Photo.UserComment"] = exifComment;
#else
#else
// Older versions took a UCS2-String, see bug #205824
// Be aware that we are dealing with a UCS-2 string.
......@@ -276,12 +276,12 @@ bool KExiv2::setExifComment(const QString& comment, bool setProgramName) const
std::string exifComment("charset=\"Unicode\" ");
exifComment.append((const char*)ucs2, sizeof(unsigned short) * comment.length());
d->exifMetadata()["Exif.Photo.UserComment"] = exifComment;
#endif
#endif
}
}
return true;
}
catch( Exiv2::Error &e )
catch( Exiv2::Error& e )
{
d->printExiv2ExceptionError("Cannot set Exif Comment using Exiv2 ", e);
}
......@@ -289,7 +289,7 @@ bool KExiv2::setExifComment(const QString& comment, bool setProgramName) const
return false;
}
QString KExiv2::getExifTagTitle(const char *exifTagName)
QString KExiv2::getExifTagTitle(const char* exifTagName)
{
try
{
......@@ -305,7 +305,7 @@ QString KExiv2::getExifTagTitle(const char *exifTagName)
return QString();
}
QString KExiv2::getExifTagDescription(const char *exifTagName)
QString KExiv2::getExifTagDescription(const char* exifTagName)
{
try
{
......@@ -321,7 +321,7 @@ QString KExiv2::getExifTagDescription(const char *exifTagName)
return QString();
}
bool KExiv2::removeExifTag(const char *exifTagName, bool setProgramName) const
bool KExiv2::removeExifTag(const char* exifTagName, bool setProgramName) const
{
if (!setProgramId(setProgramName))
return false;
......@@ -344,7 +344,7 @@ bool KExiv2::removeExifTag(const char *exifTagName, bool setProgramName) const
return false;
}
bool KExiv2::getExifTagRational(const char *exifTagName, long int &num, long int &den, int component) const