From: kramm Date: Thu, 7 Jun 2007 19:28:14 +0000 (+0000) Subject: when rescaling images, don't omit an image if it's bitmap get's smaller X-Git-Tag: buttons-working~633 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=5b97294f0d92194820e794198456542dcf1bf3fe when rescaling images, don't omit an image if it's bitmap get's smaller than 1 pixel --- 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 */