From baf2cc6c5a55188c86fbb8012a9dedd9b1010eee Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 16 Mar 2009 07:08:35 -0500 Subject: [PATCH] fix bitmap loading of odd-width files --- basis/images/bitmap/bitmap.factor | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/basis/images/bitmap/bitmap.factor b/basis/images/bitmap/bitmap.factor index ffe3adff48..8209159a8e 100755 --- a/basis/images/bitmap/bitmap.factor +++ b/basis/images/bitmap/bitmap.factor @@ -83,14 +83,15 @@ ERROR: bmp-not-supported n ; :: fixup-color-index ( loading-bitmap -- loading-bitmap ) loading-bitmap width>> :> width + width 3 * :> width*3 loading-bitmap height>> abs :> height loading-bitmap color-index>> length :> color-index-length - height 3 * :> height*3 - color-index-length width height*3 * - height*3 /i :> misaligned - misaligned 0 > [ + color-index-length height /i :> stride + color-index-length width*3 height * - height /i :> padding + padding 0 > [ loading-bitmap [ - loading-bitmap width>> misaligned + 3 * - [ 3 misaligned * head* ] map concat + stride + [ width*3 head-slice ] map concat ] change-color-index ] [ loading-bitmap