Re: commit: Robert Wilhelm's patch


Subject: Re: commit: Robert Wilhelm's patch
From: Robert Wilhelm (robert@gaston.camelot.de)
Date: Fri Jan 04 2002 - 18:22:45 CST


Hi Patrick,

unfortunately my patch was not right. The 4Byte padding is needed,
otherwise the pictures will get some "stairway effect".

Appended is the right patch wich reverts the last change and
lets the for loop iterate m_iWidth times and not as
before sometimes m_iWidth +1 times.

May I close bug 1876?

Robert

[robert@gaston xp]$ cvs diff ie_impGraphic_BMP.cpp
Index: ie_impGraphic_BMP.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_impGraphic_BMP.cpp,v
retrieving revision 1.11
diff -u -r1.11 ie_impGraphic_BMP.cpp
--- ie_impGraphic_BMP.cpp 2002/01/04 02:52:42 1.11
+++ ie_impGraphic_BMP.cpp 2002/01/05 00:18:47
@@ -320,7 +320,7 @@
         UT_uint32 col;
         UT_uint32 position;
         UT_uint32 row_width = m_iWidth * m_iBitsPerPlane / 8;
- while ((row_width % 3) != 0) row_width++;
+ while ((row_width & 3) != 0) row_width++;
         UT_Byte* row_transformed_data = new UT_Byte[row_width];
 
         switch (m_iBitsPerPlane)
@@ -343,7 +343,7 @@
                         /* Calculating the start of each row */
                         position=m_iOffset + row*row_width;
                         /* Transforming the b/r to r/b */
- for (col=0; col < row_width; col+=3)
+ for (UT_uint32 i=0, col=0; i < m_iWidth; i++,col+=3)
                         {
                                 row_transformed_data[col+0] = (UT_Byte)*pBB->getPointer(position+col+2);
                                 row_transformed_data[col+1] = (UT_Byte)*pBB->getPointer(position+col+1);



This archive was generated by hypermail 2b25 : Fri Jan 04 2002 - 18:26:27 CST