From 81a9725218202e8471da5ae575433a3e3820497c Mon Sep 17 00:00:00 2001 From: Till Adam Date: Wed, 3 Jan 2001 21:23:45 +0000 Subject: [PATCH] fix for the other binary versions in the pnm_loader. Could someone please check if the ascii ones work right? I didnt test them. and test the binary formats too while youre at it. Thanks :) SVN revision: 4087 --- loaders/loader_pnm.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/loaders/loader_pnm.c b/loaders/loader_pnm.c index 5c26cc6..360fe04 100644 --- a/loaders/loader_pnm.c +++ b/loaders/loader_pnm.c @@ -450,9 +450,14 @@ load(ImlibImage * im, ImlibProgressFunction progress, if (((per - pper) >= progress_granularity) || (y == (im->h - 1))) { - l = y - pl; - if (!progress(im, per, 0, (y - l), im->w, l)) - { + l = y - pl; + + /* fix off by one in case of the last line */ + if (y == (im->h -1)) + l++; + + if (!progress(im, per, 0, pl, im->w, l)) + { if (data) free(data); fclose(f); @@ -577,9 +582,12 @@ load(ImlibImage * im, ImlibProgressFunction progress, if (((per - pper) >= progress_granularity) || (y == (im->h - 1))) { - l = y - pl; - if (!progress(im, per, 0, (y - l), im->w, l)) - { + /* fix off by one in case of the last line */ + if (y == (im->h -1)) + l++; + + if (!progress(im, per, 0, pl, im->w, l)) + { if (data) free(data); fclose(f); @@ -640,9 +648,12 @@ load(ImlibImage * im, ImlibProgressFunction progress, if (((per - pper) >= progress_granularity) || (y == (im->h - 1))) { - l = y - pl; - if (!progress(im, per, 0, (y - l), im->w, l)) - { + /* fix off by one in case of the last line */ + if (y == (im->h -1)) + l++; + + if (!progress(im, per, 0, pl, im->w, l)) + { if (data) free(data); fclose(f);