Mercurial > hg > octave-lojdl
changeset 9439:0a696f8aa434
determine correct image bitwidth in __magick_read__.cc
author | Benjamin Lindner <lindnerb@users.sourceforge.net> |
---|---|
date | Fri, 17 Jul 2009 15:50:50 -0400 |
parents | bac81ac76a57 |
children | 357cff83985d |
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: