git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3894aeb
)
when rescaling images, don't omit an image if it's bitmap get's smaller
author
kramm
<kramm>
Thu, 7 Jun 2007 19:28:14 +0000
(19:28 +0000)
committer
kramm
<kramm>
Thu, 7 Jun 2007 19:28:14 +0000
(19:28 +0000)
than 1 pixel
lib/devices/swf.c
patch
|
blob
|
history
diff --git
a/lib/devices/swf.c
b/lib/devices/swf.c
index
3bbf8ee
..
8ba141a
100644
(file)
--- 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) {
/// {
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) {
} 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;
return -1;
+ if(newsizex<=0)
+ newsizex = 1;
+ if(newsizey<=0)
+ newsizey = 1;
/* TODO: cache images */
/* TODO: cache images */