plug-ins: fix #1790 Artifacts when opening tif images ...

generated by matlabs blocproc function

Based on the suggested solution by Massimo, we should not compute the
remaining pixels per line but only at the end of the whole block, be it
tile or scanline.

I have not been able to find bw or palette examples that use load_separate
instead of load_contiguous, so that case is not tested. But, it also
doesn't make much sense to have planar when you have just one plane.
This commit is contained in:
Jacob Boerema
2022-06-08 13:22:46 -04:00
parent 3e6237030c
commit 94de89febf

View File

@ -2518,11 +2518,7 @@ convert_bit2byte (const guchar *src,
gint width,
gint height)
{
gint y;
for (y = 0; y < height; y++)
{
gint x = width;
gint64 x = width * height;
while (x >= 8)
{
@ -2538,7 +2534,6 @@ convert_bit2byte (const guchar *src,
dest += x;
src++;
}
}
}
static void
@ -2547,11 +2542,7 @@ convert_2bit2byte (const guchar *src,
gint width,
gint height)
{
gint y;
for (y = 0; y < height; y++)
{
gint x = width;
gint64 x = width * height;
while (x >= 4)
{
@ -2567,7 +2558,6 @@ convert_2bit2byte (const guchar *src,
dest += x;
src++;
}
}
}
static void
@ -2576,11 +2566,7 @@ convert_4bit2byte (const guchar *src,
gint width,
gint height)
{
gint y;
for (y = 0; y < height; y++)
{
gint x = width;
gint64 x = width * height;
while (x >= 2)
{
@ -2596,7 +2582,6 @@ convert_4bit2byte (const guchar *src,
dest += x;
src++;
}
}
}
static void