mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-20 19:43:01 +00:00
Better workaround for GDK bug (gdk_image_get() sets the bpp field to
1999-09-30 Tor Lillqvist <tml@iki.fi> * plug-ins/common/wmf.c (load_image): Better workaround for GDK bug (gdk_image_get() sets the bpp field to bits-per-pixel instead of bytes-per-pixel).
This commit is contained in:
parent
064ed1754c
commit
adc6303532
|
@ -1,3 +1,9 @@
|
|||
1999-09-30 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* plug-ins/common/wmf.c (load_image): Better workaround for GDK
|
||||
bug (gdk_image_get() sets the bpp field to bits-per-pixel instead
|
||||
of bytes-per-pixel).
|
||||
|
||||
1999-09-30 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/colormap_dialog.i.c: "F1" for the indexed palette dialog.
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* See http://www.iki.fi/tml/gimp/wmf/
|
||||
*/
|
||||
|
||||
#define VERSION "1999-03-17"
|
||||
#define VERSION "1999-09-30"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -2315,10 +2315,15 @@ load_image (char *filename)
|
|||
bshift = visual->blue_shift;
|
||||
|
||||
if ((image->depth > 8 && image->bpp == 1)
|
||||
|| image->bpp > 3)
|
||||
|| image->bpp > 4)
|
||||
{
|
||||
/* Workaround for bugs in GDK */
|
||||
if (image->depth > 24)
|
||||
if (image->bpp > 4)
|
||||
/* GDK has set image->bpp to bits-per-pixel,
|
||||
* correct it to bytes-per-pixel.
|
||||
*/
|
||||
image->bpp = (image->bpp + 7) / 8;
|
||||
else if (image->depth > 24)
|
||||
image->bpp = 4;
|
||||
else if (image->depth > 16)
|
||||
image->bpp = 3;
|
||||
|
|
Loading…
Reference in a new issue