From d477773fa3ed20178563c00ab9253e92c3188785 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 16 Jul 2007 14:27:37 +0000 Subject: [PATCH] fix for b/w color mode in BMP parserhttp://forum.yacy-websuche.de/viewtopic.php?f=6&t=180&hilit=&p=942#p942 see also git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3983 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/ymage/ymageBMPParser.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/ymage/ymageBMPParser.java b/source/de/anomic/ymage/ymageBMPParser.java index 74348a7cc..58da68995 100644 --- a/source/de/anomic/ymage/ymageBMPParser.java +++ b/source/de/anomic/ymage/ymageBMPParser.java @@ -173,10 +173,14 @@ public class ymageBMPParser { for (int columns = 0; columns < width; columns = columns + 4) { b = ((int) s[offset + n] & 0xff); n++; - image.setRGB(columns, (height - rows - 1), colortable.colorindex[(b & 0xc0) >> 6]); - image.setRGB(columns + 1, (height - rows - 1), colortable.colorindex[(b & 0x30) >> 4]); - image.setRGB(columns + 2, (height - rows - 1), colortable.colorindex[(b & 0xc) >> 2]); - image.setRGB(columns + 3, (height - rows - 1), colortable.colorindex[b & 0x3]); + image.setRGB(columns, (height - rows - 1), colortable.colorindex[(b & 0x80) >> 7]); + image.setRGB(columns + 1, (height - rows - 1), colortable.colorindex[(b & 0x40) >> 6]); + image.setRGB(columns + 2, (height - rows - 1), colortable.colorindex[(b & 0x20) >> 5]); + image.setRGB(columns + 3, (height - rows - 1), colortable.colorindex[(b & 0x10) >> 4]); + image.setRGB(columns + 4, (height - rows - 1), colortable.colorindex[(b & 0x08) >> 3]); + image.setRGB(columns + 5, (height - rows - 1), colortable.colorindex[(b & 0x04) >> 2]); + image.setRGB(columns + 6, (height - rows - 1), colortable.colorindex[(b & 0x02) >> 1]); + image.setRGB(columns + 7, (height - rows - 1), colortable.colorindex[ b & 0x01]); } n += fill4(n); }