本文整理汇总了C++中exiv2::exifdata::const_iterator::tagLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::tagLabel方法的具体用法?C++ const_iterator::tagLabel怎么用?C++ const_iterator::tagLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exiv2::exifdata::const_iterator
的用法示例。
在下文中一共展示了const_iterator::tagLabel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG
/** \fn ImageUtils::GetAllExifValues(const QString &)
* \brief Reads and returns all non empty tags from the given file
* \param fileName The filename that holds the exif data
* \return The list of exif tag names and values
*/
QList<QStringList> ImageUtils::GetAllExifValues(const QString &fileName)
{
// default value, an empty list means no
// exif tags were found or an error occured
QList<QStringList> valueList;
try
{
Exiv2::Image::AutoPtr image =
Exiv2::ImageFactory::open(fileName.toLocal8Bit().constData());
if (image.get())
{
image->readMetadata();
Exiv2::ExifData &exifData = image->exifData();
if (!exifData.empty())
{
LOG(VB_GENERAL, LOG_DEBUG,
QString("Found %1 tag(s) for file %2")
.arg(exifData.count())
.arg(fileName));
Exiv2::ExifData::const_iterator end = exifData.end();
Exiv2::ExifData::const_iterator i = exifData.begin();
for (; i != end; ++i)
{
QString value = QString::fromStdString(i->value().toString());
// Do not add empty tags to the list
if (!value.isEmpty())
{
QStringList values;
// These three are the same as i->key()
values.append(QString::fromStdString(i->familyName()));
values.append(QString::fromStdString(i->groupName()));
values.append(QString::fromStdString(i->tagName()));
values.append(QString::fromStdString(i->key()));
values.append(QString::fromStdString(i->tagLabel()));
values.append(QString::fromStdString(i->value().toString()));
// Add the exif information to the list
valueList.append(values);
}
}
}
else
{
LOG(VB_GENERAL, LOG_ERR,
QString("Exiv2 error: No header, file %1")
.arg(fileName));
}
}
else
{
LOG(VB_GENERAL, LOG_ERR,
QString("Exiv2 error: Could not open file, file %1")
.arg(fileName));
}
}
catch (Exiv2::Error& e)
{
LOG(VB_GENERAL, LOG_ERR,
QString("Exiv2 exception %1, file %2")
.arg(e.what()).arg(fileName));
}
return valueList;
}