swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] resizing


From: Daniel Caillibaud
Subject: Re: [Swftools-common] resizing
Date: Wed, 06 Aug 2008 19:55:44 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080707)

Matthias Kramm a écrit :
On Wed, Jul 16, 2008 at 04:49:28AM +0700, Cornelis Brouwers <address@hidden> 
wrote:
Is there any way to resize the images that come from pdf to swf with pdf2swf?
sometimes images are like 2000x1000 while it's sufficient to have like 200x100.

pdf2swf -s subpixels=1 file.pdf -o file.swf

converts images so that they have exactly the resolution they need
for normal (unzoomed) display. (Like 200x100, in this case)

I just see this interesting post.
Since which swftools version is this implemented ?

This option is a good one, but I don't really understand how to use it in case I want an image just at the double resolution (to have the good resolution with a zoom x2). I tried -s subpixels=0.5 and -s subpixels=2 but in both case, I have a better result on zoom without this option set. Is this normal ?

--
Daniel

PS: I didn't posted on this list yet but I really apreciate these tools, in 
some case I really save hours of boring work ;-)

PS2: just for the fun, my last command line with png2swf & swf combine (to put a big png (zoom) in a 600x820 swf with the good position). We can see that most of the work is to write the right awk expression, not choosing the good args for swftools ;-)

for f in png_src/*.png; do \
  echo; echo $f; \
  eval $(identify $f|sed -e 's/.*PNG \([0-9]\+\)x\([0-9]\+\).*/\1 \2/'|awk 
'{x=$1; y=$2};
    END {
      a=60000/x; b=82000/y;
      if (a < b) {
        scale=a; decaly=(820-y*scale/100)/2;
        if (decaly >20) arg="-y 20 ";
        else arg="-y " decaly -decaly % 1
      } else {
        scale=b; decalx=(600-(x*scale/100))/2; arg="-x " decalx - decalx % 1
      };
      print "scale=" scale " arg=\"" arg "\""
    }'); \
  echo "We have scale=$scale and arg=$arg"; \
  png2swf -s $scale -o tmp.swf $f; \
  swfcombine -T -o swf/$(basename $f .png).swf white_background_600x820.swf 
$arg tmp.swf;\
done;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]