imagehandlingutilities/thumbnailmanager/plugins/image/src/thumbnailimagedecoder.cpp
changeset 15 7197e789b953
parent 14 2edacbf5d3f9
child 17 ffa62e555b02
equal deleted inserted replaced
14:2edacbf5d3f9 15:7197e789b953
   163     
   163     
   164     TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() iOriginalSize = %d x %d", iOriginalSize.iWidth, iOriginalSize.iHeight );
   164     TN_DEBUG3( "CThumbnailImageDecoder::DecodeL() iOriginalSize = %d x %d", iOriginalSize.iWidth, iOriginalSize.iHeight );
   165 
   165 
   166     //Size in both x and y dimension must be non-zero, positive value
   166     //Size in both x and y dimension must be non-zero, positive value
   167     TSize loadSize( iOriginalSize) ;
   167     TSize loadSize( iOriginalSize) ;
   168     
       
   169     
   168     
   170     if(iOriginalSize.iHeight < iSize.iHeight || iOriginalSize.iWidth < iSize.iWidth )
   169     if(iOriginalSize.iHeight < iSize.iHeight || iOriginalSize.iWidth < iSize.iWidth )
   171         {
   170         {
   172         loadSize = iOriginalSize;
   171         loadSize = iOriginalSize;
   173         TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() LoadSize is OriginalSize" );
   172         TN_DEBUG1( "CThumbnailImageDecoder::DecodeL() LoadSize is OriginalSize" );
   223             }
   222             }
   224         TN_DEBUG4( 
   223         TN_DEBUG4( 
   225             "CThumbnailImageDecoder::DecodeL() - loadSize = (%d,%d) reduction = 1/%d ", loadSize.iWidth, loadSize.iHeight, reductionFactor );
   224             "CThumbnailImageDecoder::DecodeL() - loadSize = (%d,%d) reduction = 1/%d ", loadSize.iWidth, loadSize.iHeight, reductionFactor );
   226         }
   225         }
   227 
   226 
   228     User::LeaveIfError( iBitmap->Create( loadSize, aDisplayMode ));
   227     TInt err = iBitmap->Create( loadSize, aDisplayMode );
       
   228     if (err != KErrNone)
       
   229         {
       
   230         delete iBitmap;
       
   231         iBitmap = NULL;
       
   232         User::Leave(err);
       
   233         }
   229 
   234 
   230     iDecoder->Convert( &iStatus, * iBitmap );
   235     iDecoder->Convert( &iStatus, * iBitmap );
   231     while ( iStatus == KErrUnderflow )
   236     while ( iStatus == KErrUnderflow )
   232         {
   237         {
   233         iDecoder->ContinueConvert( &iStatus );
   238         iDecoder->ContinueConvert( &iStatus );