openbsd-ports/graphics/imlib/patches/patch-Imlib_load_c
2002-05-17 02:42:15 +00:00

41 lines
1.2 KiB
Plaintext

--- Imlib/load.c.orig Fri Mar 22 09:43:04 2002
+++ Imlib/load.c Thu May 16 22:12:55 2002
@@ -254,7 +254,8 @@ _LoadPNG(ImlibData * id, FILE * f, int *
png_read_image(png_ptr, lines);
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
ptr = data;
- if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ if (color_type == PNG_COLOR_TYPE_GRAY
+ || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
{
for (y = 0; y < *h; y++)
{
@@ -279,6 +280,7 @@ _LoadPNG(ImlibData * id, FILE * f, int *
}
}
}
+#if 0
else if (color_type == PNG_COLOR_TYPE_GRAY)
{
for (y = 0; y < *h; y++)
@@ -294,6 +296,7 @@ _LoadPNG(ImlibData * id, FILE * f, int *
}
}
}
+#endif
else
{
for (y = 0; y < *h; y++)
@@ -645,9 +648,9 @@ _LoadBMP(ImlibData * id, FILE *file, int
planes = (int)word;
fread(&word, 2, 1, file);
bpp = (int)word;
- if (bpp != 1 && bpp != 4 && bpp != 8 && bpp && 16 && bpp != 24 && bpp != 32)
+ if (bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32)
{
- fprintf(stderr, "IMLIB ERROR: unknown bitdepth in file\n");
+ fprintf(stderr, "IMLIB ERROR: unknown bitdepth %d in file\n", bpp);
return NULL;
}
fread(dbuf, 4, 4, file);