diff -r 7fdbb852d323 -r fc3320e39880 messagingappbase/msgeditor/mediacontrolsrc/MsgImageControl.cpp --- a/messagingappbase/msgeditor/mediacontrolsrc/MsgImageControl.cpp Wed Sep 01 12:31:54 2010 +0100 +++ b/messagingappbase/msgeditor/mediacontrolsrc/MsgImageControl.cpp Tue Sep 14 21:11:56 2010 +0300 @@ -153,26 +153,23 @@ Min( sourceSize.iWidth, iMaxSize.iWidth - iFrame->FrameBorderSize().iWidth ), Min( sourceSize.iHeight, iMaxSize.iHeight - iFrame->FrameBorderSize().iHeight ) ); + // In case of KImageTypePNGUid and KImageTypeBMPUid + // with and without IsAnimation, call CreateImageViewerL with + // Flags zero. This to avoid image corruption when IsAnimation is flase and + // Image resize happened based on control size. + + TUint32 flagOptions = 0; + if ( !iSourceImage->IsAnimation() && - ( iSourceImage->ImageType() == KImageTypeBMPUid || - iSourceImage->ImageType() == KImageTypeGIFUid || - iSourceImage->ImageType() == KImageTypePNGUid ) ) + iSourceImage->ImageType() == KImageTypeGIFUid ) { - iEngine = IHLViewerFactory::CreateImageViewerL( targetSize, - *iSourceImage, - *iDestinationBitmap, - *this, - MIHLImageViewer::EOptionUseBilinearInterpolation); - } - else - { - iEngine = IHLViewerFactory::CreateImageViewerL( targetSize, - *iSourceImage, - *iDestinationBitmap, - *this, - 0 ); - - } + flagOptions |= MIHLImageViewer::EOptionUseBilinearInterpolation; + } + iEngine = IHLViewerFactory::CreateImageViewerL( targetSize, + *iSourceImage, + *iDestinationBitmap, + *this, + flagOptions); } // ---------------------------------------------------------