GunnarMonell / fbgrab

fbgrab linux framebuffer screenshot utility.
GNU General Public License v2.0
147 stars 28 forks source link

Floating point exception #8

Open PartialVolume opened 2 years ago

PartialVolume commented 2 years ago

When I use the command fbgrab -v image.png (version 1.5) I get a floating point exception error and no image produced. I can compile from source if you need me to test on the hardware that's producing this issue.

fbgrab -v -d /dev/fb0 image.png
frame buffer fixed info:
id: "VGA16 VGA"
type: EGA/VGA planes
Floating point exception

if I then run fbset -i, I get the following:

fbset -i

mode "640x480x16"
    # D: 25.176 MHz, H: 31.469 KHz, V: 59.942 Hz
    geometry 640 480 640 480 4
    timings 39721 48 16 33 10 96 2
    rgba 6/0,6/0,6/0,0/0
endmode

Frame buffer device information:
    Name        :  VGA16 VGA
    Address     :  0xa0000
    Size        :  65536
    Type        :  VGA 16 colors in 4 planes
    Visual      :  PSEUDOCOLOR
    XPanStep    :  8
    YPanStep    :  1
    YWrapStep   :  0
    LineLength  :  80
    Accelerator :  No

As a comparison, on the same hardware, if I switch the framebuffer to 1280x800x32 using the the command gfxpayload=1280x800x32 placed in grub.cfg then fbgrab works ok.

fbgrab -v image.png
frame buffer fixed info:
id: "simple"
type: packed pixels
line length: 1520 bytes (1280 pixels)

frame buffer variable info:
resolution 1280x800
virtual resolution: 1280x800
offset:0x0
bits_per_pixel: 32
greyscale: false
red:  offset: 16, length: 8, msb_right: 0
green:  offset: 8, length: 8, msb_right: 0
blue:  offset: 0, length: 8, msb_right: 0
alpha:   offset: 24, length: 8, msb_right: 0
pixel format: standard
Resolution: 1280x800 depth 32
Converting image from 32
Now writing PNG file (compression -1)
GunnarMonell commented 2 years ago

Hi, Sorry for the late feedback!

I've never implemented 1, 2, 4 nor 8 bit color. That does not excuse the floating point exception though. Fixing that is the least I can do.

Unfortunately I don't have time implementing these color modes (but I'd gladly accept a patch!). They are, and has forever been in the todo section of the man page ;)

PartialVolume commented 2 years ago

No problem, I'm using fbgrab with ShredOS and having been playing with the various frame buffers. I'm not sure whether it's much of an issue for ShredOS as I think we use 16/32 bit most of the time. If it looks like having 4 or 8 bit would be beneficial I may submit a patch. Thanks again for a very useful program.