[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/digikam/libs
From:       Marcel Wiesweg <marcel.wiesweg () gmx ! de>
Date:       2010-03-07 13:58:53
Message-ID: 1267970333.274895.9136.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1100409 by mwiesweg:

For RAW files, do not display the color profile of the preview,
but instead show "Uncalibrated color space"

CCBUG: 229370

 M  +7 -3      imageproperties/imagepropertiescolorstab.cpp  
 M  +29 -4     widgets/iccprofiles/cietonguewidget.cpp  
 M  +1 -0      widgets/iccprofiles/cietonguewidget.h  
 M  +5 -0      widgets/iccprofiles/iccprofilewidget.cpp  
 M  +1 -0      widgets/iccprofiles/iccprofilewidget.h  


--- trunk/extragear/graphics/digikam/libs/imageproperties/imagepropertiescolorstab.cpp #1100408:1100409
@@ -662,15 +662,19 @@
 
 void ImagePropertiesColorsTab::getICCData()
 {
-    if (d->image.getIccProfile().isNull())
+    if (DImg::fileFormat(d->currentFilePath) == DImg::RAW)
     {
-        d->iccProfileWidget->setLoadingFailed();
+        d->iccProfileWidget->setUncalibratedColor();
     }
-    else
+    else if (!d->image.getIccProfile().isNull())
     {
         d->embedded_profile = d->image.getIccProfile();
         d->iccProfileWidget->loadProfile(d->currentFilePath, d->embedded_profile);
     }
+    else
+    {
+        d->iccProfileWidget->setLoadingFailed();
+    }
 }
 
 }  // namespace Digikam
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/cietonguewidget.cpp #1100408:1100409
@@ -162,6 +162,7 @@
         loadingImageMode     = false;
         loadingImageSucess   = false;
         needUpdatePixmap     = false;
+        uncalibratedColor    = false;
         hMonitorProfile      = 0;
         hXYZProfile          = 0;
         hXFORM               = 0;
@@ -176,6 +177,7 @@
     bool             loadingImageMode;
     bool             loadingImageSucess;
     bool             needUpdatePixmap;
+    bool             uncalibratedColor;
 
     int              xBias;
     int              yBias;
@@ -269,6 +271,7 @@
     }
 
     d->loadingImageMode = false;
+    d->uncalibratedColor = false;
 
     d->progressTimer->stop();
     d->needUpdatePixmap = true;
@@ -302,6 +305,9 @@
         d->loadingImageSucess   = false;
     }
 
+    d->loadingImageMode = false;
+    d->uncalibratedColor = false;
+
     d->progressTimer->stop();
     d->needUpdatePixmap = true;
     update();
@@ -706,6 +712,16 @@
     update();
 }
 
+void CIETongueWidget::uncalibratedColor()
+{
+    d->progressTimer->stop();
+    d->progressCount      = 0;
+    d->loadingImageMode   = false;
+    d->loadingImageSucess = false;
+    d->uncalibratedColor  = true;
+    update();
+}
+
 void CIETongueWidget::updatePixmap()
 {
     d->needUpdatePixmap = false;
@@ -797,7 +813,7 @@
         return;
     }
 
-    // No profile data to show.
+    // No profile data to show, or RAW file
 
     if (!d->profileDataAvailable || (!d->loadingImageMode && !d->loadingImageSucess))
     {
@@ -808,10 +824,19 @@
 
         p.setPen(pen);
         p.drawRect(0, 0, width(), height());
-        p.setPen(Qt::red);
-        p.drawText(0, 0, width(), height(), Qt::AlignCenter,
-                   i18n("No profile available..."));
 
+        if (d->uncalibratedColor)
+        {
+            p.drawText(0, 0, width(), height(), Qt::AlignCenter,
+                    i18n("Uncalibrated color space"));
+        }
+        else
+        {
+            p.setPen(Qt::red);
+            p.drawText(0, 0, width(), height(), Qt::AlignCenter,
+                    i18n("No profile available..."));
+        }
+
         return;
     }
 
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/cietonguewidget.h #1100408:1100409
@@ -67,6 +67,7 @@
 
     void loadingStarted();
     void loadingFailed();
+    void uncalibratedColor();
 
 protected:
 
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/iccprofilewidget.cpp #1100408:1100409
@@ -219,6 +219,11 @@
     d->cieTongue->loadingFailed();
 }
 
+void ICCProfileWidget::setUncalibratedColor()
+{
+    d->cieTongue->uncalibratedColor();
+}
+
 QString ICCProfileWidget::getMetadataTitle()
 {
     return i18n("ICC Color Profile Information");
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/iccprofilewidget.h #1100408:1100409
@@ -59,6 +59,7 @@
 
     void    setLoadingFailed();
     void    setDataLoading();
+    void    setUncalibratedColor();
 
     bool  setProfile(const IccProfile& profile = IccProfile());
     IccProfile getProfile() const;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic