Mercurial > hg > octave-lojdl
changeset 12044:8dcae1dfc9a0 release-3-2-x
determine correct image bitwidth in __magick_read__.cc
author | Benjamin Lindner <lindnerb@users.sourceforge.net> |
---|---|
date | Sat, 25 Jul 2009 16:20:05 +0200 |
parents | 2246eadc1bb3 |
children | 42d51e66729b |
files | src/ChangeLog src/DLD-FUNCTIONS/__magick_read__.cc |
diffstat | 2 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-07-17 Benjamin Lindner <lindnerb@users.sourceforge.net> + + * DLD-FUNCTIONS/__magick_read__.cc (F__magick_read__): + Determine correct number of bits required when reading images. + 2009-07-16 John W. Eaton <jwe@octave.org> * graphics.cc (get_array_limits): Require min_pos value to be
--- a/src/DLD-FUNCTIONS/__magick_read__.cc +++ b/src/DLD-FUNCTIONS/__magick_read__.cc @@ -416,11 +416,15 @@ else { unsigned int depth = imvec[0].modulusDepth (); - int i = 0; - while (depth >>= 1) - i++; - depth = 1 << i; - + if (depth > 1) + { + --depth; + int i = 1; + while (depth >>= 1) + i++; + depth = 1 << i; + } + switch (depth) { case 1: