SVN commit 539211 by cgilles:
digikam from trunk : - DImg API : new method to store an ICC profile in image container from an ICC profile file. - image editor DImg interface : store the input ICC profile used in color management workflow into the current DImg instance of image editor. - When a RAW image is saved like PNG, TIFF, or JPEG, the input profile (camera profile in fact) is saved in target file like UFRAW does. CCMAIL: [hidden email], [hidden email] M +13 -0 libs/dimg/dimg.cpp M +1 -0 libs/dimg/dimg.h M +4 -1 utilities/imageeditor/canvas/dimginterface.cpp --- trunk/extragear/graphics/digikam/libs/dimg/dimg.cpp #539210:539211 @@ -568,6 +568,19 @@ return m_priv->isReadOnly; } +bool DImg::setICCProfilFromFile(const QString& filePath) +{ + QFile file(filePath); + if ( !file.open(IO_ReadOnly) ) + return false; + + QByteArray data(file.size()); + QDataStream stream( &file ); + stream.readRawBytes(data.data(), data.size()); + setICCProfil(data); + return true; +} + void DImg::setICCProfil(const QByteArray& profile) { m_priv->ICCProfil = profile; --- trunk/extragear/graphics/digikam/libs/dimg/dimg.h #539210:539211 @@ -209,6 +209,7 @@ QByteArray getIptc() const; QByteArray metadata(METADATA key) const; + bool setICCProfilFromFile(const QString& filePath); void setICCProfil(const QByteArray& profile); QByteArray getICCProfil() const; --- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/dimginterface.cpp #539210:539211 @@ -231,8 +231,10 @@ // Ask or apply? if (apply) { - trans.setProfiles( QFile::encodeName(d->cmSettings->inputSetting), QFile::encodeName(d->cmSettings->workspaceSetting)); + trans.setProfiles( QFile::encodeName(d->cmSettings->inputSetting), + QFile::encodeName(d->cmSettings->workspaceSetting)); trans.apply( d->image ); + d->image.setICCProfilFromFile(QFile::encodeName(d->cmSettings->inputSetting)); } else { @@ -253,6 +255,7 @@ trans.setProfiles( QFile::encodeName(d->cmSettings->inputSetting), QFile::encodeName(d->cmSettings->workspaceSetting)); trans.apply( d->image ); + d->image.setICCProfilFromFile(QFile::encodeName(d->cmSettings->inputSetting)); } } } _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |