[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: Nick Brown <nickbroon () blueyonder ! co ! uk>
Date: 2005-08-20 21:34:22
Message-ID: 20050820213422.24295.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
nickbroon blueyonder co uk changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From nickbroon blueyonder co uk 2005-08-20 23:34 -------
SVN commit 451500 by nickbroon:
FEATURE: 109836
Add Support for displaying Face: header
M +44 -0 headerstyle.cpp
--- branches/KDE/3.5/kdepim/kmail/headerstyle.cpp #451499:451500
@ -525,6 +525,50 @
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 no longer than 998 bytes
+ if ( facestring.length() < 998 )
+ {
+ QByteArray facearray;
+ KCodecs::base64Decode(facestring, facearray);
+
+ QImage faceimage;
+ if ( TRUE == 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
QString xfaceURL;
QString xfhead = message->headerField( "X-Face" );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic