From 5b97294f0d92194820e794198456542dcf1bf3fe Mon Sep 17 00:00:00 2001 From: kramm Date: Thu, 7 Jun 2007 19:28:14 +0000 Subject: [PATCH] when rescaling images, don't omit an image if it's bitmap get's smaller than 1 pixel --- lib/devices/swf.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/devices/swf.c b/lib/devices/swf.c index 3bbf8ee..8ba141a 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -1876,16 +1876,20 @@ static int add_image(swfoutput_internal*i, gfximage_t*img, int targetwidth, int /// { if(is_jpeg && i->config_jpegsubpixels) { - newsizex = (int)(targetwidth*i->config_jpegsubpixels+0.5); - newsizey = (int)(targetheight*i->config_jpegsubpixels+0.5); + newsizex = (int)(targetwidth*i->config_jpegsubpixels + 0.5); + newsizey = (int)(targetheight*i->config_jpegsubpixels + 0.5); } else if(!is_jpeg && i->config_ppmsubpixels) { - newsizex = (int)(targetwidth*i->config_ppmsubpixels+0.5); - newsizey = (int)(targetheight*i->config_ppmsubpixels+0.5); + newsizex = (int)(targetwidth*i->config_ppmsubpixels + 0.5); + newsizey = (int)(targetheight*i->config_ppmsubpixels + 0.5); } /// } - if(sizex<=0 || sizey<=0 || newsizex<=0 || newsizey<=0) + if(sizex<=0 || sizey<=0) return -1; + if(newsizex<=0) + newsizex = 1; + if(newsizey<=0) + newsizey = 1; /* TODO: cache images */ -- 1.7.10.4