moved image rescaler to lib/gfximage.c
[swftools.git] / lib / devices / swf.c
index 182aa55..3be81d5 100644 (file)
@@ -42,7 +42,7 @@
 #include "../gfxtools.h"
 #include "swf.h"
 #include "../gfxpoly.h"
-#include "../png.h"
+#include "../gfximage.h"
 
 #define CHARDATAMAX 1024
 #define CHARMIDX 0
@@ -2255,7 +2255,9 @@ static int add_image(swfoutput_internal*i, gfximage_t*img, int targetwidth, int
     
     if(newsizex<sizex || newsizey<sizey) {
        msg("<verbose> Scaling %dx%d image to %dx%d", sizex, sizey, newsizex, newsizey);
-       newpic = swf_ImageScale(mem, sizex, sizey, newsizex, newsizey);
+       gfximage_t*ni = gfximage_rescale(img, newsizex, newsizey);
+       newpic = (RGBA*)ni->data;
+       free(ni);
        *newwidth = sizex = newsizex;
        *newheight  = sizey = newsizey;
        mem = newpic;
@@ -2970,11 +2972,6 @@ static void swf_addfont(gfxdevice_t*dev, gfxfont_t*font)
                    l->swffont->layout->bounds[iii].xmax/20.0,
                    l->swffont->layout->bounds[iii].ymax/20.0
                    );
-           int t;
-           for(t=0;t<l->swffont->maxascii;t++) {
-               if(l->swffont->ascii2glyph[t] == iii)
-                   msg("<debug> | - maps to %d",t);
-           }
        }
     }
 }