fiximg
616 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/csh
# set echo
set imgname = $1
set xmult = $2
set sizes=`imgsize $imgname`
@ sx = $sizes[1]
@ tx = $sx + $xmult - 1
@ tx = $tx / $xmult
@ tx = $tx * $xmult
if ($tx > 32) then
@ tx = 32
endif
@ sy = $sizes[2]
@ ty = $sy + $xmult - 1
@ ty = $ty / $xmult
@ ty = $ty * $xmult
if ($ty > 32) then
@ ty = 32
endif
echo -n Scale in X by " "
echo $tx / $sx | bc -l
echo -n Scale in Y by " "
echo $ty / $sy | bc -l
imscale -bilinear -xsize $tx -ysize $ty -infile $imgname -outfile Resize$imgname
mv Resize$imgname $imgname
# izoom $imgname Resize$imgname `echo $tx / $sx | bc -l` 1.0 -t -w 0.1