digiKam
|
Classes | |
class | Private |
Public Types | |
enum | ScanMode { NewScan , ModifiedScan , Rescan } |
Public Member Functions | |
const ItemScanInfo & | itemScanInfo () const |
ItemScanner (const QFileInfo &info) | |
ItemScanner (const QFileInfo &info, const ItemScanInfo &Iteminfo) | |
ItemScanner (qlonglong imageid) | |
void | loadFromDisk () |
void | setCategory (DatabaseItem::Category category) |
~ItemScanner () | |
Static Public Member Functions | |
static QString | formatToString (const QString &format) |
Operations on History Metadata | |
bool | hasHistoryToResolve () const |
void | scanBalooInfo () |
scanBalooInfo - retrieve tags, comments and rating from Baloo Desktop service. More... | |
static bool | resolveImageHistory (qlonglong id, QList< qlonglong > *needTaggingIds=nullptr) |
static bool | resolveImageHistory (qlonglong imageId, const QString &historyXml, QList< qlonglong > *needTaggingIds=nullptr) |
static void | tagItemHistoryGraph (qlonglong id) |
static DImageHistory | resolvedImageHistory (const DImageHistory &history, bool mustBeAvailable=false) |
static bool | sameReferredImage (const HistoryImageId &id1, const HistoryImageId &id2) |
static QList< qlonglong > | resolveHistoryImageId (const HistoryImageId &historyId) |
void | scanImageHistory () |
void | commitImageHistory () |
void | scanImageHistoryIfModified () |
QString | uniqueHash () const |
Operations with Database | |
void | newFile (int albumId) |
void | newFileFullScan (int albumId) |
void | rescan () |
void | commit () |
qlonglong | id () const |
void | copiedFrom (int albumId, qlonglong srcId) |
static void | sortByProximity (QList< ItemInfo > &infos, const ItemInfo &subject) |
bool | copyFromSource (qlonglong src) |
void | commitCopyImageAttributes () |
void | prepareAddImage (int albumId) |
bool | commitAddImage () |
Operations on File Metadata | |
void | fileModified () |
static void | fillCommonContainer (qlonglong imageid, ImageCommonContainer *const container) |
static QDateTime | creationDateFromFilesystem (const QFileInfo &info) |
void | prepareUpdateImage () |
void | commitUpdateImage () |
bool | scanFromIdenticalFile () |
void | scanFile (ScanMode mode) |
void | scanItemInformation () |
void | commitItemInformation () |
Operations on Photo Metadata | |
static QString | iptcCorePropertyName (MetadataInfo::Field field) |
static MetadataFields | allImageMetadataFields () |
QString | detectImageFormat () const |
void | scanImageMetadata () |
void | commitImageMetadata () |
void | scanItemPosition () |
void | commitItemPosition () |
void | scanItemComments () |
void | commitItemComments () |
void | scanItemCopyright () |
void | commitItemCopyright () |
void | scanIPTCCore () |
void | commitIPTCCore () |
void | scanTags () |
void | commitTags () |
void | scanFaces () |
void | commitFaces () |
bool | checkRatingFromMetadata (const QVariant &ratingFromMetadata) const |
void | checkCreationDateFromMetadata (QVariant &dateFromMetadata) const |
Operations on Video Metadata | |
static void | fillVideoMetadataContainer (qlonglong imageid, VideoMetadataContainer *const container) |
void | scanVideoInformation () |
void | scanVideoMetadata () |
void | commitVideoMetadata () |
QString | detectVideoFormat () const |
QString | detectAudioFormat () const |
static MetadataFields | allVideoMetadataFields () |
Digikam::ItemScanner::ItemScanner | ( | const QFileInfo & | info, |
const ItemScanInfo & | Iteminfo | ||
) |
Construct an ItemScanner object from an existing QFileInfo and ItemScanInfo object. This constructor shall be used with fileModified() or fullScan().
References Digikam::ItemScanner::Private::fileInfo, and Digikam::ItemScanner::Private::scanInfo.
|
explicit |
Construct an ItemScanner from an existing QFileInfo object. Use this constructor if you intend to call newFile().
References Digikam::ItemScanner::Private::fileInfo.
|
explicit |
Construct an ItemScanner for an image in the database. File info, Scan info and the category will be retrieved from the database.
References Digikam::ItemShortInfo::album, Digikam::ItemShortInfo::albumRootID, Digikam::CollectionManager::albumRootPath(), Digikam::CoreDbAccess::db(), Digikam::ItemScanner::Private::fileInfo, Digikam::CoreDbUrl::fileUrl(), Digikam::CoreDbUrl::fromAlbumAndName(), Digikam::CoreDB::getItemScanInfo(), Digikam::CoreDB::getItemShortInfo(), Digikam::CollectionManager::instance(), Digikam::ItemShortInfo::itemName, and Digikam::ItemScanner::Private::scanInfo.
Digikam::ItemScanner::~ItemScanner | ( | ) |
References Digikam::ItemScanner::Private::timer.
|
static |
References Digikam::MetadataInfo::Aperture, Digikam::MetadataInfo::ExposureMode, Digikam::MetadataInfo::ExposureProgram, Digikam::MetadataInfo::ExposureTime, Digikam::MetadataInfo::FlashMode, Digikam::MetadataInfo::FocalLength, Digikam::MetadataInfo::FocalLengthIn35mm, Digikam::MetadataInfo::Lens, Digikam::MetadataInfo::Make, Digikam::MetadataInfo::MeteringMode, Digikam::MetadataInfo::Model, Digikam::MetadataInfo::Sensitivity, Digikam::MetadataInfo::SubjectDistance, Digikam::MetadataInfo::SubjectDistanceCategory, Digikam::MetadataInfo::WhiteBalance, and Digikam::MetadataInfo::WhiteBalanceColorTemperature.
Referenced by scanImageMetadata().
|
staticprotected |
References Digikam::MetadataInfo::AspectRatio, Digikam::MetadataInfo::AudioBitRate, Digikam::MetadataInfo::AudioChannelType, Digikam::MetadataInfo::AudioCodec, Digikam::MetadataInfo::Duration, Digikam::MetadataInfo::FrameRate, and Digikam::MetadataInfo::VideoCodec.
Referenced by fillVideoMetadataContainer(), and scanVideoMetadata().
|
protected |
References creationDateFromFilesystem(), and Digikam::ItemScanner::Private::fileInfo.
Referenced by scanItemInformation(), and scanVideoInformation().
|
protected |
References Rescan, and Digikam::ItemScanner::Private::scanMode.
Referenced by scanItemInformation(), and scanVideoInformation().
void Digikam::ItemScanner::commit | ( | ) |
Commits the scanned information to the database. You must call this after scanning was done for any changes to take effect. Only this method will perform write operations to the database.
References Digikam::ItemScannerCommit::AddItem, Digikam::ItemScanner::Private::commit, commitAddImage(), commitCopyImageAttributes(), commitFaces(), Digikam::ItemScannerCommit::commitFaces, commitImageHistory(), commitImageMetadata(), Digikam::ItemScannerCommit::commitImageMetadata, commitIPTCCore(), Digikam::ItemScannerCommit::commitIPTCCore, commitItemComments(), Digikam::ItemScannerCommit::commitItemComments, commitItemCopyright(), Digikam::ItemScannerCommit::commitItemCopyright, commitItemInformation(), Digikam::ItemScannerCommit::commitItemInformation, commitItemPosition(), Digikam::ItemScannerCommit::commitItemPosition, commitTags(), commitUpdateImage(), commitVideoMetadata(), Digikam::ItemScannerCommit::commitVideoMetadata, Digikam::ItemScannerCommit::copyImageAttributesId, Digikam::ItemScannerCommit::NoOp, Digikam::ItemScannerCommit::operation, Digikam::ItemScannerCommit::tagIds, Digikam::ItemScanner::Private::timer, and Digikam::ItemScannerCommit::UpdateItem.
Referenced by Digikam::CollectionScanner::Private::finishScanner().
|
protected |
References Digikam::CoreDB::addItem(), Digikam::ItemScanInfo::albumID, Digikam::ItemScanInfo::category, Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::copyImageAttributesId, Digikam::CoreDbAccess::db(), Digikam::ItemScanInfo::fileSize, Digikam::CoreDB::findImageId(), Digikam::ItemScanInfo::id, Digikam::ItemScanInfo::itemName, Digikam::ItemScanInfo::modificationDate, Digikam::ItemScanner::Private::scanInfo, Digikam::CoreDB::setItemAlbum(), Digikam::CoreDB::setItemStatus(), Digikam::ItemScanInfo::status, Digikam::DatabaseItem::Trashed, Digikam::ItemScanInfo::uniqueHash, and Digikam::DatabaseItem::Visible.
Referenced by commit().
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::CoreDB::copyImageAttributes(), Digikam::ItemScannerCommit::copyImageAttributesId, Digikam::SimilarityDb::copySimilarityAttributes(), Digikam::CoreDbAccess::db(), Digikam::SimilarityDbAccess::db(), Digikam::DatabaseRelation::Grouped, Digikam::ItemScanInfo::id, Digikam::CoreDB::removeAllImageRelationsFrom(), Digikam::CoreDB::removeAllImageRelationsTo(), and Digikam::ItemScanner::Private::scanInfo.
Referenced by commit().
|
protected |
References Digikam::FaceTagsEditor::add(), Digikam::FaceTagsEditor::addManually(), Digikam::TagRegion::adjustToOrientation(), Digikam::ItemScanner::Private::commit, Digikam::FaceTagsEditor::databaseFaces(), Digikam::FaceTags::getOrCreateTagForPerson(), Digikam::ItemScanInfo::id, Digikam::ItemScanner::Private::img, Digikam::ItemScannerCommit::metadataFacesMap, Digikam::DImg::orientation(), Digikam::FaceTagsIface::region(), Digikam::TagRegion::relativeToAbsolute(), Digikam::FaceTagsEditor::removeFace(), Digikam::ItemScanner::Private::scanInfo, Digikam::ItemInfo::setTag(), Digikam::DImg::size(), Digikam::TagRegion::toRect(), Digikam::FaceTagsIface::UnknownName, and Digikam::FaceTags::unknownPersonTagId().
Referenced by commit().
|
protected |
References Digikam::CoreDB::addItemTag(), Digikam::ItemScanner::Private::commit, Digikam::CoreDbAccess::db(), Digikam::ItemScanner::Private::hasHistoryToResolve, Digikam::ItemScannerCommit::historyXml, Digikam::ItemScanInfo::id, Digikam::TagsCache::instance(), Digikam::InternalTagName::needResolvingHistory(), Digikam::ItemScanner::Private::scanInfo, Digikam::CoreDB::setImageUuid(), Digikam::CoreDB::setItemHistory(), and Digikam::ItemScannerCommit::uuid.
Referenced by commit().
|
protected |
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::ItemScanInfo::id, Digikam::ItemScannerCommit::iptcCoreMetadataInfos, Digikam::IptcCoreLocationInfo::isNull(), Digikam::ItemScanner::Private::scanInfo, Digikam::ItemExtendedProperties::setIntellectualGenre(), Digikam::ItemExtendedProperties::setJobId(), Digikam::ItemExtendedProperties::setLocation(), Digikam::ItemExtendedProperties::setScene(), and Digikam::ItemExtendedProperties::setSubjectCode().
Referenced by commit().
|
protected |
References Digikam::ItemComments::addHeadline(), Digikam::ItemComments::addTitle(), Digikam::ItemScannerCommit::captions, Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::headline, Digikam::ItemScanInfo::id, Digikam::ItemComments::replaceComments(), Digikam::ItemScanner::Private::scanInfo, and Digikam::ItemScannerCommit::title.
Referenced by commit().
|
protected |
|
protected |
References Digikam::CoreDB::addItemInformation(), Digikam::CoreDB::changeItemInformation(), Digikam::ItemScanner::Private::commit, Digikam::CoreDbAccess::db(), Digikam::ItemScanInfo::id, Digikam::ItemScannerCommit::imageInformationFields, Digikam::ItemScannerCommit::imageInformationInfos, NewScan, Digikam::ItemScanner::Private::scanInfo, and Digikam::ItemScanner::Private::scanMode.
Referenced by commit().
|
protected |
|
protected |
References Digikam::CoreDB::addTagsToItems(), Digikam::TagsCache::colorLabelTags(), Digikam::ItemScanner::Private::commit, Digikam::CoreDbAccess::db(), Digikam::CoreDB::getItemTagIDs(), Digikam::ItemScannerCommit::hasColorTag, Digikam::ItemScannerCommit::hasPickTag, Digikam::ItemScanInfo::id, Digikam::TagsCache::instance(), Digikam::TagsCache::pickLabelTags(), Digikam::CoreDB::removeTagsFromItems(), Digikam::ItemScanner::Private::scanInfo, and Digikam::ItemScannerCommit::tagIds.
Referenced by commit().
|
protected |
References Digikam::ItemScanInfo::category, Digikam::CoreDbAccess::db(), Digikam::ItemScanInfo::fileSize, Digikam::ItemScanInfo::id, Digikam::ItemScanInfo::modificationDate, Digikam::ItemScanner::Private::scanInfo, Digikam::ItemScanInfo::uniqueHash, and Digikam::CoreDB::updateItem().
Referenced by commit().
|
protected |
void Digikam::ItemScanner::copiedFrom | ( | int | albumId, |
qlonglong | srcId | ||
) |
Similar to newFile. Call this when you want ItemScanner to add a new file to the database which is a copy of another file, copying attributes from the src and rescanning other attributes as appropriate. Give the id of the album of the new file, and the id of the src file.
References copyFromSource(), loadFromDisk(), NewScan, prepareAddImage(), scanFile(), and scanFromIdenticalFile().
Referenced by Digikam::CollectionScanner::scanNewFile().
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::copyImageAttributesId, Digikam::CoreDbAccess::db(), Digikam::ItemScanner::Private::fileInfo, Digikam::CoreDB::getItemScanInfo(), Digikam::ItemScanInfo::id, and Digikam::ItemScanner::Private::scanInfo.
Referenced by copiedFrom().
|
static |
Returns a suitable creation date from file system information. Use this as a fallback if metadata is not available.
Referenced by checkCreationDateFromMetadata(), Digikam::UMSCamera::getItemInfo(), and Digikam::UMSCamera::uploadItem().
|
protected |
References Digikam::ItemScanner::Private::fileInfo.
Referenced by scanVideoInformation().
|
protected |
References Digikam::DImg::detectedFormat(), Digikam::ItemScanner::Private::fileInfo, Digikam::DImg::HEIF, DigikamGenericTwitterPlugin::imageFormat(), Digikam::ItemScanner::Private::img, Digikam::DImg::JP2K, Digikam::DImg::JPEG, Digikam::DImg::NONE, Digikam::DImg::PGF, Digikam::DImg::PNG, Digikam::DImg::QIMAGE, Digikam::DImg::RAW, and Digikam::DImg::TIFF.
Referenced by scanItemInformation().
|
protected |
References Digikam::ItemScanner::Private::fileInfo, and suffix.
Referenced by scanVideoInformation().
void Digikam::ItemScanner::fileModified | ( | ) |
Call this when you have detected that a file in the database has been modified on disk. Only two groups of fields will be updated in the database:
References loadFromDisk(), ModifiedScan, prepareUpdateImage(), and scanFile().
Referenced by Digikam::CollectionScanner::scanFileUpdateHashReuseThumbnail(), and Digikam::CollectionScanner::scanModifiedFile().
|
static |
Returns File-metadata container with user-presentable information. These methods provide the reverse service: Not writing into the db, but reading from the db.
References Digikam::DatabaseFields::Category, Digikam::DatabaseFields::ColorDepth, Digikam::ImageCommonContainer::colorDepth, Digikam::DatabaseFields::ColorModel, Digikam::ImageCommonContainer::colorModel, Digikam::DImg::colorModelToString(), Digikam::DatabaseFields::CreationDate, Digikam::ImageCommonContainer::creationDate, Digikam::CoreDbAccess::db(), Digikam::DatabaseFields::DigitizationDate, Digikam::ImageCommonContainer::digitizationDate, Digikam::ImageCommonContainer::fileModificationDate, Digikam::ImageCommonContainer::fileName, Digikam::DatabaseFields::FileSize, Digikam::ImageCommonContainer::fileSize, Digikam::DatabaseFields::Format, Digikam::ImageCommonContainer::format, formatToString(), Digikam::CoreDB::getImagesFields(), Digikam::CoreDB::getItemInformation(), Digikam::DatabaseFields::Height, Digikam::ImageCommonContainer::height, Digikam::DatabaseFields::ModificationDate, Digikam::DatabaseFields::Name, Digikam::DatabaseFields::Orientation, Digikam::ImageCommonContainer::orientation, Digikam::MetadataInfo::Orientation, Digikam::DatabaseFields::Rating, Digikam::ImageCommonContainer::rating, Digikam::DMetadata::valueToString(), Digikam::DatabaseItem::Video, Digikam::DMetadata::videoColorModelToString(), Digikam::DatabaseFields::Width, and Digikam::ImageCommonContainer::width.
Referenced by Digikam::ItemInfo::imageCommonContainer().
|
static |
Returns Video container with user-presentable information. These methods provide the reverse service: Not writing into the db, but reading from the db.
References Digikam::VideoMetadataContainer::allFieldsNull, allVideoMetadataFields(), Digikam::VideoMetadataContainer::aspectRatio, Digikam::VideoMetadataContainer::audioBitRate, Digikam::VideoMetadataContainer::audioChannelType, Digikam::VideoMetadataContainer::audioCodec, Digikam::CoreDbAccess::db(), Digikam::VideoMetadataContainer::duration, Digikam::VideoMetadataContainer::frameRate, Digikam::CoreDB::getVideoMetadata(), Digikam::DMetadata::valuesToString(), and Digikam::VideoMetadataContainer::videoCodec.
|
static |
Helper method to translate enum values to user presentable strings
Referenced by Digikam::ItemViewImportDelegate::drawImageFormat(), and fillCommonContainer().
bool Digikam::ItemScanner::hasHistoryToResolve | ( | ) | const |
Returns true if this file has been marked as needing history resolution at a later stage
References Digikam::ItemScanner::Private::hasHistoryToResolve.
Referenced by Digikam::CollectionScanner::Private::finishScanner().
qlonglong Digikam::ItemScanner::id | ( | ) | const |
Returns the image id of the scanned file, if (yet) available.
References Digikam::ItemScanInfo::id, and Digikam::ItemScanner::Private::scanInfo.
Referenced by Digikam::CollectionScanner::Private::finishScanner(), Digikam::CollectionScanner::scanNewFile(), and Digikam::CollectionScanner::scanNewFileFullScan().
|
static |
Helper method to return official property name by which IPTC core properties are stored in the database (ItemCopyright and ImageProperties table). Allowed arguments: All MetadataInfo::Fields starting with "IptcCore..."
References Digikam::MetadataInfo::IptcCoreCity, Digikam::MetadataInfo::IptcCoreContactInfoAddress, Digikam::MetadataInfo::IptcCoreContactInfoCity, Digikam::MetadataInfo::IptcCoreContactInfoCountry, Digikam::MetadataInfo::IptcCoreContactInfoEmail, Digikam::MetadataInfo::IptcCoreContactInfoPhone, Digikam::MetadataInfo::IptcCoreContactInfoPostalCode, Digikam::MetadataInfo::IptcCoreContactInfoProvinceState, Digikam::MetadataInfo::IptcCoreContactInfoWebUrl, Digikam::MetadataInfo::IptcCoreCopyrightNotice, Digikam::MetadataInfo::IptcCoreCountry, Digikam::MetadataInfo::IptcCoreCountryCode, Digikam::MetadataInfo::IptcCoreCreator, Digikam::MetadataInfo::IptcCoreCreatorJobTitle, Digikam::MetadataInfo::IptcCoreInstructions, Digikam::MetadataInfo::IptcCoreIntellectualGenre, Digikam::MetadataInfo::IptcCoreJobID, Digikam::MetadataInfo::IptcCoreLocation, Digikam::MetadataInfo::IptcCoreProvider, Digikam::MetadataInfo::IptcCoreProvinceState, Digikam::MetadataInfo::IptcCoreRightsUsageTerms, Digikam::MetadataInfo::IptcCoreScene, Digikam::MetadataInfo::IptcCoreSource, and Digikam::MetadataInfo::IptcCoreSubjectCode.
Referenced by Digikam::ItemCopyright::allCopyrightNotices(), Digikam::ItemCopyright::allRightsUsageTerms(), Digikam::ItemCopyright::contactInfo(), Digikam::ItemCopyright::copyrightNotice(), Digikam::ItemCopyright::creator(), Digikam::ItemCopyright::creatorJobTitle(), Digikam::ItemCopyright::instructions(), Digikam::ItemExtendedProperties::intellectualGenre(), Digikam::ItemExtendedProperties::jobId(), Digikam::ItemExtendedProperties::location(), Digikam::ItemCopyright::provider(), Digikam::ItemCopyright::removeContactInfo(), Digikam::ItemCopyright::removeCopyrightNotices(), Digikam::ItemCopyright::removeCreatorJobTitle(), Digikam::ItemCopyright::removeCreators(), Digikam::ItemCopyright::removeInstructions(), Digikam::ItemCopyright::removeProvider(), Digikam::ItemCopyright::removeRightsUsageTerms(), Digikam::ItemCopyright::removeSource(), Digikam::ItemCopyright::rightsUsageTerms(), Digikam::ItemExtendedProperties::scene(), Digikam::ItemCopyright::setContactInfo(), Digikam::ItemCopyright::setCopyrightNotice(), Digikam::ItemCopyright::setCreator(), Digikam::ItemCopyright::setCreatorJobTitle(), Digikam::ItemCopyright::setInstructions(), Digikam::ItemExtendedProperties::setIntellectualGenre(), Digikam::ItemExtendedProperties::setJobId(), Digikam::ItemExtendedProperties::setLocation(), Digikam::ItemCopyright::setProvider(), Digikam::ItemCopyright::setRightsUsageTerms(), Digikam::ItemExtendedProperties::setScene(), Digikam::ItemCopyright::setSource(), Digikam::ItemExtendedProperties::setSubjectCode(), Digikam::ItemCopyright::source(), and Digikam::ItemExtendedProperties::subjectCode().
const ItemScanInfo & Digikam::ItemScanner::itemScanInfo | ( | ) | const |
Provides access to the information retrieved by scanning. The validity depends on the previously executed scan.
References Digikam::ItemScanner::Private::scanInfo.
Referenced by Digikam::CollectionScanner::scanFileUpdateHashReuseThumbnail().
void Digikam::ItemScanner::loadFromDisk | ( | ) |
Loads data from disk (metadata, image file properties). This method is called from any of the main entry points above. You can call it before if you want to control the time when it is executed. Calling it a second time with data already loaded will do nothing.
References Digikam::ItemScanInfo::category, Digikam::MetaEngine::data(), Digikam::ItemScanner::Private::fileInfo, Digikam::ItemScanInfo::fileSize, Digikam::ItemScanner::Private::hasImage, Digikam::ItemScanner::Private::hasMetadata, Digikam::MetaEngine::hasSidecar(), Digikam::DatabaseItem::Image, Digikam::ItemScanner::Private::img, Digikam::MetaEngineSettings::instance(), Digikam::ItemScanInfo::itemName, Digikam::DMetadata::load(), Digikam::ItemScanner::Private::loadedFromDisk, Digikam::DImg::loadItemInfo(), Digikam::ItemScanner::Private::metadata, Digikam::ItemScanInfo::modificationDate, Digikam::DMetadata::registerMetadataSettings(), Digikam::ItemScanner::Private::scanInfo, Digikam::DImg::setMetadata(), Digikam::MetaEngineSettings::settings(), Digikam::MetaEngine::sidecarPath(), Digikam::ItemScanInfo::uniqueHash, uniqueHash(), Digikam::MetaEngineSettingsContainer::updateFileTimeStamp, and Digikam::MetaEngineSettingsContainer::useXMPSidecar4Reading.
Referenced by copiedFrom(), fileModified(), newFile(), newFileFullScan(), and rescan().
void Digikam::ItemScanner::newFile | ( | int | albumId | ) |
Call this when you want ItemScanner to add a new file to the database and read all information into the database.
References loadFromDisk(), NewScan, prepareAddImage(), scanFile(), and scanFromIdenticalFile().
Referenced by Digikam::CollectionScanner::scanNewFile().
void Digikam::ItemScanner::newFileFullScan | ( | int | albumId | ) |
Call this when you want ItemScanner to add a new file to the database and read all information into the database. This variant will not use the unique hash to establish identify with an existing entry, but read all information newly from the file.
References loadFromDisk(), NewScan, prepareAddImage(), and scanFile().
Referenced by Digikam::CollectionScanner::scanNewFileFullScan().
|
protected |
References Digikam::ItemScannerCommit::AddItem, Digikam::ItemScanInfo::albumID, Digikam::ItemScanner::Private::commit, Digikam::ItemScanner::Private::fileInfo, Digikam::ItemScannerCommit::operation, Digikam::ItemScanner::Private::scanInfo, Digikam::ItemScanInfo::status, and Digikam::DatabaseItem::Visible.
Referenced by copiedFrom(), newFile(), and newFileFullScan().
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::operation, and Digikam::ItemScannerCommit::UpdateItem.
Referenced by fileModified(), and rescan().
void Digikam::ItemScanner::rescan | ( | ) |
Call this to take an existing image in the database, but re-read all information from the file into the database, possibly overwriting information there.
References loadFromDisk(), prepareUpdateImage(), Rescan, and scanFile().
Referenced by Digikam::CollectionScanner::rescanFile().
|
static |
All referred images of the given history will be resolved. In the returned history, the actions are the same, while each referred image actually exists in the collection (if mustBeAvailable is true, it is even in a currently available collection). That means the number of referred images may be less or greater than initially. Note that this history may have peculiar properties, like multiple Original or Current entries (if the source entry resolves to multiple collection images), so this history is only for internal use, not for storage.
References Digikam::DImageHistory::Entry::action, Digikam::ItemInfo::albumRootId(), Digikam::DImageHistory::entries(), Digikam::ItemInfo::historyImageId(), Digikam::CollectionManager::instance(), Digikam::ItemInfo::isNull(), Digikam::RedEye::location(), Digikam::CollectionManager::locationForAlbumRootId(), Digikam::DImageHistory::Entry::referredImages, resolveHistoryImageId(), and Digikam::HistoryImageId::setType().
|
static |
Returns all image ids fulfilling the given image id.
References Digikam::CollectionManager::album(), Digikam::CoreDbAccess::db(), Digikam::HistoryImageId::filePath(), Digikam::CoreDB::findByNameAndCreationDate(), Digikam::CoreDB::getIdenticalFiles(), Digikam::CoreDB::getItemsForUuid(), Digikam::CoreDB::getItemShortInfo(), Digikam::HistoryImageId::hasCreationDate(), Digikam::HistoryImageId::hasFileName(), Digikam::HistoryImageId::hasFileOnDisk(), Digikam::HistoryImageId::hasUniqueHashIdentifier(), Digikam::HistoryImageId::hasUuid(), Digikam::ItemShortInfo::id, Digikam::ItemScanInfo::id, Digikam::CollectionManager::instance(), Digikam::RedEye::location(), Digikam::CollectionManager::locationForPath(), Digikam::HistoryImageId::m_creationDate, Digikam::HistoryImageId::m_fileName, Digikam::HistoryImageId::m_fileSize, Digikam::HistoryImageId::m_uniqueHash, Digikam::HistoryImageId::m_uuid, Digikam::DatabaseItem::Obsolete, Digikam::HistoryImageId::path(), Digikam::ItemScanInfo::status, and Digikam::DatabaseItem::Trashed.
Referenced by Digikam::ItemHistoryGraphData::addVertex(), and resolvedImageHistory().
|
static |
Resolves the image history of the image id by filling the ImageRelations table for all contained referred images. If needTaggingIds is given, all ids marked for needing tagging of the history graph are added.
References Digikam::CoreDbAccess::db(), Digikam::CoreDB::getItemHistory(), and Digikam::ImageHistoryEntry::history.
Referenced by Digikam::CollectionScanner::historyScanningStage2().
|
static |
Stage 2 of history scanning
References Digikam::CoreDB::addImageRelations(), Digikam::CoreDB::addItemTag(), Digikam::ItemHistoryGraph::addScannedHistory(), Digikam::ItemHistoryGraph::allImageIds(), Digikam::CoreDbAccess::db(), Digikam::DatabaseRelation::DerivedFrom, Digikam::DImageHistory::fromXml(), Digikam::TagsCache::getOrCreateInternalTag(), Digikam::ItemHistoryGraph::hasEdges(), Digikam::ItemHistoryGraph::hasUnresolvedEntries(), Digikam::TagsCache::instance(), Digikam::DImageHistory::isNull(), Digikam::InternalTagName::needResolvingHistory(), Digikam::InternalTagName::needTaggingHistoryGraph(), Digikam::ItemHistoryGraph::relationCloudParallel(), Digikam::CoreDB::removeTagsFromItems(), and Digikam::ItemHistoryGraph::rootImages().
|
static |
Determines if the two ids refer to the same image. Does not check if such a referred image really exists.
References Digikam::HistoryImageId::hasCreationDate(), Digikam::HistoryImageId::hasFileName(), Digikam::HistoryImageId::hasFileOnDisk(), Digikam::HistoryImageId::hasUniqueHashIdentifier(), Digikam::HistoryImageId::hasUuid(), Digikam::HistoryImageId::isValid(), Digikam::HistoryImageId::m_creationDate, Digikam::HistoryImageId::m_fileName, Digikam::HistoryImageId::m_filePath, Digikam::HistoryImageId::m_fileSize, Digikam::HistoryImageId::m_uniqueHash, and Digikam::HistoryImageId::m_uuid.
Referenced by Digikam::HistoryVertexProperties::operator==().
void Digikam::ItemScanner::scanBalooInfo | ( | ) |
scanBalooInfo - retrieve tags, comments and rating from Baloo Desktop service.
References Digikam::CaptionValues::caption, Digikam::ItemScannerCommit::captions, Digikam::BalooInfo::comment, Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::commitItemComments, Digikam::ItemScanner::Private::fileInfo, Digikam::TagsCache::getOrCreateTags(), Digikam::BalooWrap::getSemanticInfo(), Digikam::BalooWrap::getSyncToDigikam(), Digikam::ItemScannerCommit::imageInformationFields, Digikam::ItemScannerCommit::imageInformationInfos, Digikam::TagsCache::instance(), Digikam::BalooWrap::instance(), Digikam::DatabaseFields::Rating, Digikam::BalooInfo::rating, Digikam::ItemScannerCommit::tagIds, and Digikam::BalooInfo::tags.
Referenced by scanFile().
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::commitFaces, Digikam::DMetadata::getItemFacesMap(), Digikam::ItemScanner::Private::img, Digikam::ItemScanner::Private::metadata, Digikam::ItemScannerCommit::metadataFacesMap, and Digikam::DImg::size().
Referenced by scanFile().
|
protected |
References Digikam::DatabaseItem::Audio, Digikam::ItemScanInfo::category, Digikam::CoreDB::clearMetadataFromImage(), Digikam::MetaEngineSettingsContainer::clearMetadataIfRescan, Digikam::CoreDbAccess::db(), Digikam::ItemScanner::Private::hasMetadata, Digikam::ItemScanInfo::id, Digikam::DatabaseItem::Image, Digikam::MetaEngineSettings::instance(), ModifiedScan, Digikam::DatabaseItem::Other, Rescan, scanBalooInfo(), scanFaces(), scanImageHistory(), scanImageHistoryIfModified(), scanImageMetadata(), Digikam::ItemScanner::Private::scanInfo, scanIPTCCore(), scanItemComments(), scanItemCopyright(), scanItemInformation(), scanItemPosition(), Digikam::ItemScanner::Private::scanMode, scanTags(), scanVideoInformation(), scanVideoMetadata(), Digikam::MetaEngineSettings::settings(), and Digikam::DatabaseItem::Video.
Referenced by copiedFrom(), fileModified(), newFile(), newFileFullScan(), and rescan().
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::copyImageAttributesId, Digikam::CoreDbAccess::db(), Digikam::ItemScanner::Private::fileInfo, Digikam::ItemScanInfo::fileSize, Digikam::CoreDB::getIdenticalFiles(), Digikam::ItemScanInfo::id, Digikam::ItemScanner::Private::scanInfo, and Digikam::ItemScanInfo::uniqueHash.
Referenced by copiedFrom(), and newFile().
|
protected |
Stage 1 of history scanning
References Digikam::ItemScanner::Private::commit, Digikam::DMetadata::getItemHistory(), Digikam::DMetadata::getItemUniqueId(), Digikam::ItemScannerCommit::historyXml, Digikam::ItemScanner::Private::metadata, and Digikam::ItemScannerCommit::uuid.
Referenced by scanFile(), and scanImageHistoryIfModified().
|
protected |
|
protected |
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::commitIPTCCore, Digikam::DMetadata::getMetadataFields(), Digikam::MetadataInfo::IptcCoreIntellectualGenre, Digikam::MetadataInfo::IptcCoreJobID, Digikam::MetadataInfo::IptcCoreLocationInfo, Digikam::ItemScannerCommit::iptcCoreMetadataInfos, Digikam::MetadataInfo::IptcCoreScene, Digikam::MetadataInfo::IptcCoreSubjectCode, and Digikam::ItemScanner::Private::metadata.
Referenced by scanFile().
|
protected |
References Digikam::ItemScannerCommit::captions, Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::commitItemComments, Digikam::DMetadata::getItemComments(), Digikam::DMetadata::getMetadataFields(), Digikam::ItemScannerCommit::headline, Digikam::MetadataInfo::Headline, Digikam::ItemScanner::Private::metadata, Digikam::ItemScannerCommit::title, and Digikam::MetadataInfo::Title.
Referenced by scanFile().
|
protected |
|
protected |
References checkCreationDateFromMetadata(), checkRatingFromMetadata(), Digikam::DatabaseFields::ColorDepth, Digikam::DatabaseFields::ColorModel, Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::commitItemInformation, Digikam::MetadataInfo::CreationDate, detectImageFormat(), Digikam::MetadataInfo::DigitizationDate, Digikam::DatabaseFields::Format, Digikam::DMetadata::getMetadataFields(), Digikam::DatabaseFields::Height, Digikam::ItemScannerCommit::imageInformationFields, Digikam::ItemScannerCommit::imageInformationInfos, Digikam::ItemScanner::Private::img, Digikam::DatabaseFields::ItemInformationAll, Digikam::ItemScanner::Private::metadata, NewScan, Digikam::MetadataInfo::Orientation, Digikam::DImg::originalBitDepth(), Digikam::DImg::originalColorModel(), Digikam::DatabaseFields::Rating, Digikam::MetadataInfo::Rating, Rescan, Digikam::ItemScanner::Private::scanMode, Digikam::DImg::size(), and Digikam::DatabaseFields::Width.
Referenced by scanFile().
|
protected |
References Digikam::MetadataInfo::Altitude, Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::commitItemPosition, Digikam::DMetadata::getMetadataFields(), Digikam::ItemScannerCommit::imagePositionInfos, Digikam::MetadataInfo::Latitude, Digikam::MetadataInfo::LatitudeNumber, Digikam::MetadataInfo::Longitude, Digikam::MetadataInfo::LongitudeNumber, Digikam::ItemScanner::Private::metadata, Digikam::MetadataInfo::PositionAccuracy, Digikam::MetadataInfo::PositionDescription, Digikam::MetadataInfo::PositionOrientation, Digikam::MetadataInfo::PositionRoll, and Digikam::MetadataInfo::PositionTilt.
Referenced by scanFile().
|
protected |
References Digikam::ItemScanner::Private::commit, Digikam::DMetadata::getItemColorLabel(), Digikam::DMetadata::getItemPickLabel(), Digikam::DMetadata::getMetadataField(), Digikam::TagsCache::getOrCreateTags(), Digikam::ItemScannerCommit::hasColorTag, Digikam::ItemScannerCommit::hasPickTag, Digikam::TagsCache::instance(), Digikam::MetadataInfo::Keywords, Digikam::ItemScanner::Private::metadata, Digikam::TagsCache::tagForColorLabel(), Digikam::TagsCache::tagForPickLabel(), and Digikam::ItemScannerCommit::tagIds.
Referenced by scanFile().
|
protected |
References Digikam::ItemScanInfo::category, checkCreationDateFromMetadata(), checkRatingFromMetadata(), Digikam::DatabaseFields::ColorDepth, Digikam::DatabaseFields::ColorModel, Digikam::ItemScanner::Private::commit, Digikam::ItemScannerCommit::commitItemInformation, Digikam::DatabaseFields::CreationDate, Digikam::MetadataInfo::CreationDate, detectAudioFormat(), detectVideoFormat(), Digikam::DatabaseFields::DigitizationDate, Digikam::MetadataInfo::DigitizationDate, Digikam::DatabaseFields::Format, Digikam::DMetadata::getMetadataField(), Digikam::DMetadata::getMetadataFields(), Digikam::DatabaseFields::Height, Digikam::ItemScannerCommit::imageInformationFields, Digikam::ItemScannerCommit::imageInformationInfos, Digikam::ItemScanner::Private::metadata, NewScan, Digikam::DatabaseFields::Orientation, Digikam::MetadataInfo::Orientation, Digikam::DatabaseFields::Rating, Digikam::MetadataInfo::Rating, Rescan, Digikam::ItemScanner::Private::scanInfo, Digikam::ItemScanner::Private::scanMode, Digikam::DatabaseItem::Video, Digikam::MetadataInfo::VideoBitDepth, Digikam::MetadataInfo::VideoColorSpace, Digikam::MetadataInfo::VideoHeight, Digikam::MetadataInfo::VideoWidth, and Digikam::DatabaseFields::Width.
Referenced by scanFile().
|
protected |
void Digikam::ItemScanner::setCategory | ( | DatabaseItem::Category | category | ) |
Inform the scanner about the category of the file. Required at least for newFile() calls, recommended for calls with the first constructor above as well.
References Digikam::ItemScanInfo::category, and Digikam::ItemScanner::Private::scanInfo.
Referenced by Digikam::CollectionScanner::rescanFile(), Digikam::CollectionScanner::scanFileUpdateHashReuseThumbnail(), Digikam::CollectionScanner::scanModifiedFile(), Digikam::CollectionScanner::scanNewFile(), and Digikam::CollectionScanner::scanNewFileFullScan().
|
static |
Sort a list of infos by proximity to the given subject. Infos are near if they are e.g. in the same album. They are not near if they are e.g. in different collections.
References Digikam::ItemInfo::isNull().
Referenced by Digikam::ItemHistoryGraph::sortForInfo().
|
static |
Takes the history graph reachable from the given image, and assigns versioning tags to all entries based on history image types and graph structure
Stage 3 of history scanning
References Digikam::CoreDB::addTagsToItems(), Digikam::ItemHistoryGraph::allImageIds(), Digikam::ItemHistoryGraph::categorize(), Digikam::HistoryImageId::Current, Digikam::InternalTagName::currentVersion(), Digikam::CoreDbAccess::db(), Digikam::ItemHistoryGraph::fromInfo(), Digikam::TagsCache::getOrCreateInternalTag(), Digikam::ItemHistoryGraph::hasEdges(), Digikam::TagsCache::instance(), Digikam::HistoryImageId::Intermediate, Digikam::InternalTagName::intermediateVersion(), Digikam::ItemInfo::isNull(), Digikam::ItemHistoryGraph::LoadAll, Digikam::InternalTagName::needTaggingHistoryGraph(), Digikam::ItemHistoryGraph::NoProcessing, Digikam::HistoryImageId::Original, Digikam::InternalTagName::originalVersion(), and Digikam::CoreDB::removeTagsFromItems().
Referenced by Digikam::CollectionScanner::historyScanningStage3().
|
protected |