Version: (using KDE KDE 3.4.0) Installed from: Debian testing/unstable Packages OS: Linux Currently, if you set your display picture (avatar) for the MSN protocol to an image that is not square, kopete will stretch the image to fit into a 96x96 square. This is rarely what is wanted, since it will make any normal picture look bad as a display picture. Therefore, better behaviour would be to cut the picture to make it square, and then scale it down to 96x96. This is what all other IM clients that I've used do, and it is what people expect.
I got a patch for this ready and working in a standalone app. Will post it here tomorrow when I've made sure it works with kopete. (Still haven't quite grokked the kde build system, so I'm just recompiling kde from scratch)
Created an attachment (id=10779) [details] Correct cropping of non-square display images Applies to Kopete from KDE_3_4_BRANCH
CVS commit by ogoffart: Fix Bug 104445: MSN Display Picture Stretched BUG: 104445 Patch by Leo Spalteholz, thanks M +20 -4 msneditaccountwidget.cpp 1.35 --- kdenetwork/kopete/protocols/msn/ui/msneditaccountwidget.cpp #1.34:1.35 @@ -281,6 +281,16 @@ void MSNEditAccountWidget::slotSelectIma QImage img( path ); - img = img.smoothScale( 96, 96 ); - if ( !img.isNull() && img.save( futurName, "PNG" ) ) + + if(!img.isNull()) { + img = img.smoothScale( 96, 96, QImage::ScaleMax ); + // crop image if not square + if(img.width() > img.height()) { + img = img.copy((img.width()-img.height())/2, 0, img.height(), img.height()); + } + else if(img.height() > img.width()) { + img = img.copy(0, (img.height()-img.width())/2, img.width(), img.width()); + } + + if ( img.save( futurName, "PNG" ) ) { d->ui->m_displayPicture->setPixmap( futurName ); @@ -291,4 +301,10 @@ void MSNEditAccountWidget::slotSelectIma "Make sure that you have selected a correct image file</qt>" ), i18n( "MSN Plugin" ) ); } + } + else + { + KMessageBox::sorry( this, i18n( "<qt>An error occurred when trying to change the display picture.<br>" + "Make sure that you have selected a correct image file</qt>" ), i18n( "MSN Plugin" ) ); + } if( remoteFile ) KIO::NetAccess::removeTempFile( path ); }
You need to log in before you can comment on or make changes to this bug.