MantisBT - NetSurf
View Issue Details
0002488NetSurfFramebuffer-specificpublic2016-12-04 03:532019-05-06 13:16
ReporterAnthony J. Bentley 
Assigned To 
PlatformPowerPCOSOpenBSDOS Version
Product Version 
Target VersionFixed in Version 
Fixed in CI build #
Reported in CI build #
URL of problem page
Summary0002488: Framebuffer bad endianness when loading images
DescriptionWhen "netsurf-fb -b 8" or "netsurf-fb -b 16" is run on OpenBSD/macppc (big-endian), images are not displayed properly.

All graphics in webpages, and all framebuffer bitmaps including mouse pointer and toolbar buttons, have incorrect colors. (fb-8-16.png)

The problem is partly due to some casts of pixdata from uint8_t[] to uint32_t*:


Naively putting a byteswap in libnsfb's plotting (naive-byteswap.diff) "fixes" the issue, except it doesn't fix the throbber and it leaves some ghosting after the cursor (fb-8-16-with-naive-byteswap.png).

A better fix is probably to generate uint32_t from the start. This is platform-independent and not very intrusive (better-fix.diff), but only fixes generated/fbtk images, and doesn't help with fetched images (fb-8-16-with-better-fix.png). It's a start, though.
TagsNo tags attached.
Attached Filespng fb-8-16.png (130,366) 2016-12-04 03:53

diff naive-byteswap.diff (1,497) 2016-12-04 03:54
png fb-8-16-with-naive-byteswap.png (65,222) 2016-12-04 03:55

diff better-fix.diff (1,261) 2016-12-04 03:56
png fb-8-16-with-better-patch.png (208,814) 2016-12-04 03:58

Vincent Sanders   
2016-12-31 12:29   
will look at sorting this. currently rummaging around for a big endian system to play with.

Issue History
2016-12-04 03:53Anthony J. BentleyNew Issue
2016-12-04 03:53Anthony J. BentleyFile Added: fb-8-16.png
2016-12-04 03:54Anthony J. BentleyFile Added: naive-byteswap.diff
2016-12-04 03:55Anthony J. BentleyFile Added: fb-8-16-with-naive-byteswap.png
2016-12-04 03:56Anthony J. BentleyFile Added: better-fix.diff
2016-12-04 03:58Anthony J. BentleyFile Added: fb-8-16-with-better-patch.png
2016-12-31 12:29Vincent SandersNote Added: 0001467
2016-12-31 12:29Vincent SandersAssigned To => Vincent Sanders
2016-12-31 12:29Vincent SandersStatusnew => confirmed
2019-05-06 13:16Vincent SandersAssigned ToVincent Sanders =>