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

List:       kde-bugs-dist
Subject:    [Bug 109836] Add Support for displaying Face: header
From:       Allen Winter <winter () kde ! org>
Date:       2006-10-16 22:00:17
Message-ID: 20061016220017.27500.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=109836         
winter kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From winter kde org  2006-10-17 00:00 -------
SVN commit 596213 by winterz:

Nick's patch for displaying Face-formatted pictures in the header that has been
tested and lingering for a long time and keeps getting lost.
Ingo approved this a long time ago.

Thanks for the patch Nick, and apologies for the many delays.

BUGS: 109836


 M  +34 -0     headerstyle.cpp  


--- branches/KDE/3.5/kdepim/kmail/headerstyle.cpp #596212:596213
 @ -527,6 +527,40  @
       userHTML = "&nbsp;";
     }
 
+    if( photoURL.isEmpty() ) {
+      // no photo, look for a Face header
+      QString faceheader = message->headerField( "Face" );
+      if ( !faceheader.isEmpty() ) {
+        QImage faceimage;
+
+        kdDebug( 5006 ) << "Found Face: header" << endl;
+
+        QCString facestring = faceheader.utf8();
+        // Spec says header should be less than 998 bytes
+        // Face: is 5 characters
+        if ( facestring.length() < 993 ) {
+          QByteArray facearray;
+          KCodecs::base64Decode(facestring, facearray);
+    
+          QImage faceimage;
+          if ( faceimage.loadFromData( facearray, "png" ) ) {
+            // Spec says image must be 48x48 pixels
+            if ( (48 == faceimage.width()) && (48 == faceimage.height()) ) {
+              photoURL = imgToDataUrl( faceimage );
+              photoWidth = 48;
+              photoHeight = 48;
+            } else {
+              kdDebug( 5006 ) << "Face: header image is" << faceimage.width() << \
"by" << faceimage.height() <<"not 48x48 Pixels" << endl; +            }
+          } else {
+            kdDebug( 5006 ) << "Failed to load decoded png from Face: header" << \
endl; +          }
+        } else {
+          kdDebug( 5006 ) << "Face: header too long at " << facestring.length() << \
endl; +        }
+      }
+    }
+
     if( photoURL.isEmpty() )
     {
       // no photo, look for a X-Face header


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

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