本文整理汇总了C++中DMetadata::getPhotographInformation方法的典型用法代码示例。如果您正苦于以下问题:C++ DMetadata::getPhotographInformation方法的具体用法?C++ DMetadata::getPhotographInformation怎么用?C++ DMetadata::getPhotographInformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DMetadata
的用法示例。
在下文中一共展示了DMetadata::getPhotographInformation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openUrls
void ShowFoto::openUrls(const QList<QUrl> &urls)
{
if (!urls.isEmpty())
{
ShowfotoItemInfoList infos;
ShowfotoItemInfo iteminfo;
DMetadata meta;
for (QList<QUrl>::const_iterator it = urls.constBegin(); it != urls.constEnd(); ++it)
{
QFileInfo fi((*it).toLocalFile());
iteminfo.name = fi.fileName();
iteminfo.mime = fi.suffix();
iteminfo.size = fi.size();
iteminfo.url = QUrl::fromLocalFile(fi.filePath());
iteminfo.folder = fi.path();
iteminfo.dtime = fi.created();
meta.load(fi.filePath());
iteminfo.ctime = meta.getImageDateTime();
iteminfo.width = meta.getImageDimensions().width();
iteminfo.height = meta.getImageDimensions().height();
iteminfo.photoInfo = meta.getPhotographInformation();
infos.append(iteminfo);
}
if (d->droppedUrls)
{
//replace the equal sign with "<<" to keep the previous pics in the list
d->infoList << infos;
}
else
{
d->infoList = infos;
d->model->clearShowfotoItemInfos();
emit signalInfoList(d->infoList);
slotOpenUrl(d->thumbBar->currentInfo());
}
}
}
示例2: setCurrentItem
//.........这里部分代码省略.........
mpixels.setNum(dims.width()*dims.height()/1000000.0, 'f', 2);
str = (!dims.isValid()) ? unknown : i18n("%1x%2 (%3Mpx)",
dims.width(), dims.height(), mpixels);
d->labelImageDimensions->setAdjustedText(str);
if (!dims.isValid()) str = unknown;
else ImagePropertiesTab::aspectRatioToString(dims.width(), dims.height(), str);
d->labelImageRatio->setAdjustedText(str);
// -- Download information ------------------------------------------
d->labelNewFileName->setAdjustedText(itemInfo.downloadName.isEmpty() ? i18n("<i>unchanged</i>") : itemInfo.downloadName);
if (itemInfo.downloaded == CamItemInfo::DownloadUnknown)
{
str = unknown;
}
else if (itemInfo.downloaded == CamItemInfo::DownloadedYes)
{
str = i18n("Yes");
}
else
{
str = i18n("No");
}
d->labelAlreadyDownloaded->setAdjustedText(str);
// -- Photograph information ------------------------------------------
// Note: If something is changed here, please updated albumfiletip section too.
QString unavailable(i18n("<i>unavailable</i>"));
PhotoInfoContainer photoInfo = meta.getPhotographInformation();
if (photoInfo.isEmpty())
{
widget(1)->hide();
}
else
{
widget(1)->show();
}
ImagePropertiesTab::shortenedMakeInfo(photoInfo.make);
ImagePropertiesTab::shortenedModelInfo(photoInfo.model);
d->labelPhotoMake->setAdjustedText(photoInfo.make.isEmpty() ? unavailable : photoInfo.make);
d->labelPhotoModel->setAdjustedText(photoInfo.model.isEmpty() ? unavailable : photoInfo.model);
if (photoInfo.dateTime.isValid())
{
str = QLocale().toString(photoInfo.dateTime, QLocale::ShortFormat);
d->labelPhotoDateTime->setAdjustedText(str);
}
else
{
d->labelPhotoDateTime->setAdjustedText(unavailable);
}
d->labelPhotoLens->setAdjustedText(photoInfo.lens.isEmpty() ? unavailable : photoInfo.lens);
d->labelPhotoAperture->setAdjustedText(photoInfo.aperture.isEmpty() ? unavailable : photoInfo.aperture);
if (photoInfo.focalLength35mm.isEmpty())
{
d->labelPhotoFocalLength->setAdjustedText(photoInfo.focalLength.isEmpty() ? unavailable : photoInfo.focalLength);
}
示例3: findFromMetadata
LensFunIface::MetadataMatch LensFunIface::findFromMetadata(const DMetadata& meta)
{
MetadataMatch ret = MetadataNoMatch;
d->settings = LensFunContainer();
d->usedCamera = 0;
d->usedLens = 0;
d->lensDescription.clear();
if (meta.isEmpty())
{
qCDebug(DIGIKAM_DIMG_LOG) << "No metadata available";
return LensFunIface::MetadataUnavailable;
}
PhotoInfoContainer photoInfo = meta.getPhotographInformation();
d->makeDescription = photoInfo.make.trimmed();
d->modelDescription = photoInfo.model.trimmed();
bool exactMatch = true;
if (d->makeDescription.isEmpty())
{
qCDebug(DIGIKAM_DIMG_LOG) << "No camera maker info available";
exactMatch = false;
}
else
{
// NOTE: see bug #184156:
// Some rules to wrap unknown camera device from Lensfun database, which have equivalent in fact.
if (d->makeDescription == QLatin1String("Canon"))
{
if (d->modelDescription == QLatin1String("Canon EOS Kiss Digital X"))
{
d->modelDescription = QLatin1String("Canon EOS 400D DIGITAL");
}
if (d->modelDescription == QLatin1String("G1 X"))
{
d->modelDescription = QLatin1String("G1X");
}
}
d->lensDescription = photoInfo.lens.trimmed();
// ------------------------------------------------------------------------------------------------
DevicePtr lfCamera = findCamera(d->makeDescription, d->modelDescription);
if (lfCamera)
{
setUsedCamera(lfCamera);
qCDebug(DIGIKAM_DIMG_LOG) << "Camera maker : " << d->settings.cameraMake;
qCDebug(DIGIKAM_DIMG_LOG) << "Camera model : " << d->settings.cameraModel;
// ------------------------------------------------------------------------------------------------
// -- Performing lens description searches.
if (!d->lensDescription.isEmpty())
{
LensList lensMatches;
QString lensCutted;
LensList lensList;
// STAGE 1, search in LensFun database as well.
lensList = findLenses(d->usedCamera, d->lensDescription);
qCDebug(DIGIKAM_DIMG_LOG) << "* Check for lens by direct query (" << d->lensDescription << " : " << lensList.count() << ")";
lensMatches.append(lensList);
// STAGE 2, Adapt exiv2 strings to lensfun strings for Nikon.
lensCutted = d->lensDescription;
if (lensCutted.contains(QLatin1String("Nikon")))
{
lensCutted.remove(QLatin1String("Nikon "));
lensCutted.remove(QLatin1String("Zoom-"));
lensCutted.replace(QLatin1String("IF-ID"), QLatin1String("ED-IF"));
lensList = findLenses(d->usedCamera, lensCutted);
qCDebug(DIGIKAM_DIMG_LOG) << "* Check for Nikon lens (" << lensCutted << " : " << lensList.count() << ")";
lensMatches.append(lensList);
}
// TODO : Add here more specific lens maker rules.
// LAST STAGE, Adapt exiv2 strings to lensfun strings. Some lens description use something like that :
// "10.0 - 20.0 mm". This must be adapted like this : "10-20mm"
lensCutted = d->lensDescription;
lensCutted.replace(QRegExp(QLatin1String("\\.[0-9]")), QLatin1String("")); //krazy:exclude=doublequote_chars
lensCutted.replace(QLatin1String(" - "), QLatin1String("-"));
lensCutted.replace(QLatin1String(" mm"), QLatin1String("mn"));
lensList = findLenses(d->usedCamera, lensCutted);
qCDebug(DIGIKAM_DIMG_LOG) << "* Check for no maker lens (" << lensCutted << " : " << lensList.count() << ")";
lensMatches.append(lensList);
// Remove all duplicate lenses in the list by using QSet.
lensMatches = lensMatches.toSet().toList();
// Display the results.
if (lensMatches.isEmpty())
{
//.........这里部分代码省略.........
示例4: openFolder
void ShowFoto::openFolder(const QUrl& url)
{
if (!url.isValid() || !url.isLocalFile())
{
return;
}
// Parse image IO mime types registration to get files filter pattern.
QString filter;
QStringList mimeTypes = supportedImageMimeTypes(QIODevice::ReadOnly, filter);
QString patterns = filter.toLower();
patterns.append (QLatin1String(" "));
patterns.append (filter.toUpper());
qCDebug(DIGIKAM_SHOWFOTO_LOG) << "patterns=" << patterns;
// Get all image files from directory.
QDir dir(url.toLocalFile(), patterns);
dir.setFilter(QDir::Files);
if (!dir.exists())
{
return;
}
QFileInfoList fileinfolist = dir.entryInfoList();
if (fileinfolist.isEmpty())
{
//emit signalSorry();
return;
}
QFileInfoList::const_iterator fi;
ShowfotoItemInfoList infos;
ShowfotoItemInfo iteminfo;
DMetadata meta;
// And open all items in image editor.
for (fi = fileinfolist.constBegin(); fi != fileinfolist.constEnd(); ++fi)
{
iteminfo.name = (*fi).fileName();
iteminfo.mime = (*fi).suffix();
iteminfo.size = (*fi).size();
iteminfo.folder = (*fi).path();
iteminfo.url = QUrl::fromLocalFile((*fi).filePath());
iteminfo.dtime = (*fi).created();
meta.load((*fi).filePath());
iteminfo.ctime = meta.getImageDateTime();
iteminfo.width = meta.getImageDimensions().width();
iteminfo.height = meta.getImageDimensions().height();
iteminfo.photoInfo = meta.getPhotographInformation();
infos.append(iteminfo);
}
if (d->droppedUrls)
{
d->infoList << infos;
}
else
{
d->infoList = infos;
d->model->clearShowfotoItemInfos();
emit signalInfoList(d->infoList);
slotOpenUrl(d->thumbBar->currentInfo());
}
d->lastOpenedDirectory = QUrl::fromLocalFile(dir.absolutePath());
}