--- psiconv/trunk/lib/psiconv/parse_image.c 2004/02/25 20:56:43 230 +++ psiconv/trunk/lib/psiconv/parse_image.c 2014/10/22 12:10:22 348 @@ -1,6 +1,6 @@ /* parse_image.c - Part of psiconv, a PSION 5 file formats converter - Copyright (c) 1999-2004 Frodo Looijaard + Copyright (c) 1999-2005 Frodo Looijaard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -128,7 +128,7 @@ { int res = 0; int len = 0; - psiconv_u32 size,offset,picsize,temp,datasize,color, + psiconv_u32 size,offset,temp,datasize,color, redbits,bluebits,greenbits; psiconv_u8 byte; int leng,i; @@ -178,8 +178,6 @@ psiconv_debug(config,lev+2,off+len,"Picture Y size: %08x:",(*result)->ysize); len += 4; - picsize = (*result)->ysize * (*result)->xsize; - psiconv_progress(config,lev+2,off+len,"Going to read the real picture x size"); (*result)->pic_xsize = psiconv_read_length(config,buf,lev+2,off+len,&leng,&res); if (res) @@ -1004,15 +1002,15 @@ if (!palet.length) { if (color) { (*floats).blue[i] = ((float) (*pixel & ((1 << bluebits) - 1))) / - (1 << bluebits); + ((1 << bluebits) - 1); (*floats).green[i] = ((float) ((*pixel >> bluebits) & - ((1 << greenbits) - 1))) / (1 << greenbits); + ((1 << greenbits) - 1))) / ((1 << greenbits) - 1); (*floats).red[i] = ((float) ((*pixel >> (bluebits+greenbits)) & - ((1 << redbits) - 1))) / (1 << redbits); + ((1 << redbits) - 1))) / ((1 << redbits) - 1); } else { (*floats).red[i] = (*floats).green[i] = (*floats).blue[i] = ((float) *pixel) / - (1 << colordepth); + ((1 << colordepth) - 1); } } else { if (*pixel >= palet.length) {