Sunday, October 26, 2008

plucker gtk viewer image patch

This solves the dark image problem

diff -r f58c7099044b image.c
--- a/image.c Sun Oct 26 16:09:28 2008 +0800
+++ b/image.c Sun Oct 26 16:16:56 2008 +0800
@@ -1251,7 +1251,7 @@ static GdkPixbuf* TranscribePalmImageToG
}
memcpy (lastrow, rowbuf, bytes_per_row);
}
- else if (((flags & PALM_IS_COMPRESSED_FLAG) &&
+ else if (((flags && PALM_IS_COMPRESSED_FLAG) &&
(compression_type == PALM_COMPRESSION_NONE)) ||
(flags && PALM_IS_COMPRESSED_FLAG) == 0) {
memcpy (rowbuf, palm_ptr, bytes_per_row);
@@ -1295,11 +1295,14 @@ static GdkPixbuf* TranscribePalmImageToG
pixels[(j * 3) + 0] =
(inval >> (bits_per_pixel - palm_red_bits)) &
((1 << palm_red_bits) - 1);
+ pixels[(j * 3) + 0] <<=3;
pixels[(j * 3) + 1] =
(inval >> palm_blue_bits) & ((1 << palm_green_bits) -
1);
+ pixels[(j * 3) + 1] <<=2;
pixels[(j * 3) + 2] =
(inval >> 0) & ((1 << palm_blue_bits) - 1);
+ pixels[(j * 3) + 2] <<=3;
inbyte += 2;
}
}

2 comments:

desrod said...

Has this been submitted to the official upstream project?

thinkpad usb cdrom factory restore said...

Hi desrod,

No, I haven't submitted this to either cvs.plkr.org or ubuntu.

I'm planning to build it as a ubuntu package and upload it to my own Personal Package Archive(PPA)

Right now, it just serve my own use. If you find it useful, let me know.

PPA:
https://launchpad.net/ubuntu/+ppas