diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index bcc88e000..6de5f8454 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,6 +8,10 @@ http://www.newbreedsoftware.com/tuxpaint/ 2004.December.5 (0.9.15) + * fixed display corruption in load dialog when saved images are + from a larger display size + Albert Cahalan + * getpixel function now considers edges as extending to infinity Albert Cahalan diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 8a52cf833..326224386 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -10953,11 +10953,21 @@ static int do_open(int want_new_tool) if (img != NULL) { /* Loaded the thumbnail from one or the other location */ - show_progress_bar(); - - thumbs[num_files] = SDL_DisplayFormat(img); + + img1 = SDL_DisplayFormat(img); SDL_FreeSurface(img); + + // if too big, or too small in both dimensions, rescale it + // ( for now: using old thumbnail as source for high speed, low quality) + if (img1->w > THUMB_W-20 || img1->h > THUMB_H-20 || (img1->w < THUMB_W-20 && img1->h < THUMB_H-20) ) + { + img2 = thumbnail(img1, THUMB_W - 20, THUMB_H - 20, 0); + SDL_FreeSurface(img1); + img1 = img2; + } + + thumbs[num_files] = img1; if (thumbs[num_files] == NULL) {