FS#5697 - bmp resize patch
Opened by takka (takka) - Sunday, 23 July 2006, 01:05 GMT
Last edited by Dave Chapman (linuxstb) - Thursday, 02 October 2008, 20:45 GMT
This patch adds the ability to automatically resize bitmaps to a given size when loading from disk.
With this patch the caller of the function "read_bmp_file" is able to tell the function if a resizing
is wanted and for which dimension it is wanted.
The original patch was made by takka - who doesn't seem to be around anymore..
Since version v0.99.6 I maintain it completely and in that version I rewrote the resizing algorithm.
It's now really simple (but with our small LCDs it should not have any noticeable affect):
if a bitmap dimension is bigger than the given max-size, it will just skip some pixels.
if a bitmap dimension is smaller than the given size, it will duplicate some pixels.
If you think that's not good enough, point me to a page where a good resizing algorithm
is described in detail (without floating point calculations) and I'll try to implement
this - although I assume that algorithms which give better looking results are
also more complicated to implement and also consume more CPU time...
So I'm not sure if it would be worth the effort!
The current implementation limits the maximum bitmap width to 1024 pixel
(the height is not limited)!
This may change in future (but only if needed)...
takka initially also added a BMP viewer as an usage example -
I put it in a separate patch because it's only an example which lacks some features, is not
necessary for the usage of the resizing feature and it had not been maintained since takka's initial release!
Currently the resize patch (but not the bmpviewer) is used (and needed) by the albumart patch (
Enjoy and tell me if something does not work ;-)
(the newest patch can always be found at the end of this page...)
Thursday, 02 October 2008, 20:45 GMT
Reason for closing: Rejected
Additional comments about closing: The general view amongst the Rockbox developers is that this feature can and should be implemented by resizing the bitmap as it is being loaded.
This patch implements the feature by loading the complete bitmap into RAM and then resizing it, hence it's being rejected.
Discussion concerning the decision to close this specific patch can be found in the IRC logs here: