Projects / fbgrab / Comments

Comments for fbgrab

18 Mar 2014 20:26 ddhill

I stumbled onto an error in the code that took me a bit to puzzle out. The variables Red, Green, Blue, Alpha are used in several places as PNG character order offsets, but those values are being hammered in the info section for no apparent reason. Also added an include to get rid of a bunch of unneeded warnings. Diff below, though it would make more sense to just remove the offending lines.

~/sb/fbgrab$ diff -u fbgrab.c.orig fbgrab.c
--- fbgrab.c.orig 2014-03-18 14:49:06.090675302 -0400
+++ fbgrab.c 2014-03-18 16:22:20.390415936 -0400
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
+#include <string.h>

#include <getopt.h>
#include <sys/vt.h> /* to handle vt changing */
@@ -169,10 +170,10 @@
fprintf(stderr, "alpha: offset: %i, length: %i, msb_right: %i\n", fb_varinfo_p->transp.offset, fb_varinfo_p->transp.length, fb_varinfo_p->transp.msb_right);
fprintf(stderr, "pixel format: %s\n", fb_varinfo_p->nonstd == 0 ? "standard" : "non-standard");
}
- Blue = fb_varinfo_p->blue.offset >> 3;
- Green = fb_varinfo_p->green.offset >> 3;
- Red = fb_varinfo_p->red.offset >> 3;
- Alpha = fb_varinfo_p->transp.offset >> 3;
+ //Blue = fb_varinfo_p->blue.offset >> 3;
+ //Green = fb_varinfo_p->green.offset >> 3;
+ //Red = fb_varinfo_p->red.offset >> 3;
+ //Alpha = fb_varinfo_p->transp.offset >> 3;

(void) close(fd);
}

Screenshot

Project Spotlight

ReciJournal

An open, cross-platform journaling program.

Screenshot

Project Spotlight

Veusz

A scientific plotting package.