home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Spanish Scene 4
/
SpanishScene4.iso
/
Programas
/
EsteveBoix_Ind
/
tablePlugv12.lha
/
tablePlug12
/
rx
/
arteffect.tpx
< prev
next >
Wrap
Text File
|
1999-09-25
|
994b
|
59 lines
/*
arteffect.tpx v1.1 © 1999 Esteve Boix
Uses ArtEffect to load the images and scale them down.
This tpx uses the ArtEffect internal loaders.
Tested with ArtEffect3, should work on v2 (and v1 ???).
Args: SIZEX SIZEY JPEG_COMPRESSION
Where:
SIZEX, SIZEY Size in pixels of the thumbnail
JPEG_COMPRESSION Well...
*/
options results
parse arg maxsizex maxsizey compression infile outfile
infile=strip(infile)
outfile=strip(outfile)
address 'ArtEffect'
LoadPic '"'infile'"'
/* Obtain info about the image */
get stem size. pictureinfo
x = size.width
y = size.height
/* ...and calculate the thumbnail resolution */
comp=trunc((maxsizex/x)*y)
if comp<=maxsizey then do
scalepic maxsizex comp
end
else do
/* No */
comp2=trunc((maxsizey/y)*x)
scalepic comp2 maxsizey
end
/* And save the image */
SavePic '"'outfile'"' plugin 'JFIF-JPEG' quality '"'||compression||'"'
ClosePic