Bug 134869

Summary: high CPU usage while displaying ICC Profile
Product: [Applications] digikam Reporter: bkappler <bkappler>
Component: ColorManagement-ProfilesAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 0.9.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 0.9.0
Attachments: Example image

Description bkappler@bks-web.de 2006-09-29 22:11:30 UTC
Version:           0.9.0-beta2 (using KDE KDE 3.5.4)
Installed from:    Ubuntu Packages
Compiler:          cc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5) 
OS:                Linux

As soon as I switch to the ICC Profile tab, digikam starts using ~10-15% of the CPU (system is idle otherwise). The CPU usage remains constant until I exit the ICC profile tab again. 

Best Regards
   Bernhard
Comment 1 bkappler@bks-web.de 2006-09-29 22:13:34 UTC
Ups, some confusion.... KDE was installed from Ubuntu, digikam has been compiled from the Beta2 sources
Comment 2 caulier.gilles 2006-10-02 07:38:31 UTC
And during this time, the ICC profile diagram is displayed in the tab ? In histogram view, the color graph is available too ?

When you using Color tab, the image is loaded in background using a separated thread. This way doesn't frezze the gui. Of course, when the image is loaded, no CPU usage are require anymore.

Witch image type you use (JPEG, PNG, TIFF, RAW) ? Can you post your image in this file ?

Thanks in advance

Gilles Caulier
Comment 3 bkappler@bks-web.de 2006-10-02 23:52:56 UTC
Hi Gilles,

I'm using JPG images (from a Cannon S50 and from a Panasonic FZ-30). For both the ICC profile diagram and histogram are both viewed correctly. 

After loading an image the CPU usage of digikam goes down to 0% unless I'm viewing the ICC tab. Viewing the ICC tab digikam remains at 10-15%.

Today I also noticed that the tooltips for the icons in the ICC profile (details, save, print, ...) do not work. In the histogram tab the tooltips are working fine.
What's the last button in the ICC tab supposed to do? It does not do anything in my case?!

Best Regards
   Bernhard
Comment 4 bkappler@bks-web.de 2006-10-03 00:04:25 UTC
Created attachment 17996 [details]
Example image
Comment 5 Marcel Wiesweg 2006-10-03 13:33:14 UTC
SVN commit 591876 by mwiesweg:

Stop blink timer when ICC data is loaded
(Previously, the timer would run and triggered a full repaint every 200ms)

BUG:134869


 M  +3 -3      imageproperties/imagepropertiescolorstab.cpp  
 M  +4 -2      widgets/iccprofiles/cietonguewidget.cpp  
 M  +1 -1      widgets/iccprofiles/cietonguewidget.h  
 M  +2 -2      widgets/iccprofiles/iccprofilewidget.cpp  
 M  +1 -1      widgets/iccprofiles/iccprofilewidget.h  


--- trunk/extragear/graphics/digikam/libs/imageproperties/imagepropertiescolorstab.cpp #591875:591876
@@ -506,7 +506,7 @@
         else 
         {
             d->histogramWidget->setLoadingFailed();
-            d->iccProfileWidget->setLoadingComplete(false);
+            d->iccProfileWidget->setLoadingFailed();
             slotHistogramComputationFailed();
         }
     }
@@ -571,7 +571,7 @@
     else
     {
         d->histogramWidget->setLoadingFailed();
-        d->iccProfileWidget->setLoadingComplete(false);
+        d->iccProfileWidget->setLoadingFailed();
         slotHistogramComputationFailed();
     }
 }
@@ -793,7 +793,7 @@
 {
     if (d->image.getICCProfil().isNull())
     {
-        d->iccProfileWidget->setLoadingComplete(false);
+        d->iccProfileWidget->setLoadingFailed();
     }
     else
     {
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/cietonguewidget.cpp #591875:591876
@@ -260,6 +260,7 @@
 
     d->loadingImageMode = false;
     
+    d->blinkTimer->stop();
     repaint(false);
     return (d->profileDataAvailable);
 }
@@ -289,6 +290,7 @@
         d->loadingImageSucess   = false;
     }
 
+    d->blinkTimer->stop();
     repaint(false);
     return (d->profileDataAvailable);
 }
@@ -681,11 +683,11 @@
     d->blinkTimer->start(200);
 }
 
-void CIETongueWidget::loadingComplete(bool b)
+void CIETongueWidget::loadingFailed()
 {
     d->blinkTimer->stop();
     d->loadingImageMode   = false;
-    d->loadingImageSucess = b;
+    d->loadingImageSucess = false;
     repaint(false);
 }
 
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/cietonguewidget.h #591875:591876
@@ -65,7 +65,7 @@
     bool setProfileFromFile(const KURL& file=KURL());
     
     void loadingStarted();
-    void loadingComplete(bool);
+    void loadingFailed();
 
 protected:
 
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/iccprofilewidget.cpp #591875:591876
@@ -187,9 +187,9 @@
     d->cieTongue->loadingStarted();
 }
 
-void ICCProfileWidget::setLoadingComplete(bool b)
+void ICCProfileWidget::setLoadingFailed()
 {
-    d->cieTongue->loadingComplete(b);
+    d->cieTongue->loadingFailed();
 }
 
 QString ICCProfileWidget::getMetadataTitle(void)
--- trunk/extragear/graphics/digikam/libs/widgets/iccprofiles/iccprofilewidget.h #591875:591876
@@ -52,7 +52,7 @@
 
     QString getMetadataTitle(void);
 
-    void    setLoadingComplete(bool b);
+    void    setLoadingFailed();
     void    setDataLoading();
 
 protected slots: