Use TIFFReadRGBAImageOriented with a parameter of ORIENTATION_TOPLEFT instead of using TIFFReadRGBAImage (which uses ORIENTATION_BOTTOMLEFT) to read images in a more logical order and simplify code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68943
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if ( hasAlpha )
image->SetAlpha();
- if (!TIFFReadRGBAImage( tif, w, h, raster, 0 ))
+ if (!TIFFReadRGBAImageOriented( tif, w, h, raster, ORIENTATION_TOPLEFT, 0 ))
{
if (verbose)
{
}
unsigned char *ptr = image->GetData();
- ptr += w*3*(h-1);
unsigned char *alpha = image->GetAlpha();
- if ( hasAlpha )
- alpha += w*(h-1);
uint32 pos = 0;
pos++;
}
-
- // subtract line we just added plus one line:
- ptr -= 2*w*3;
- if ( hasAlpha )
- alpha -= 2*w;
}