home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Spanish Scene 4
/
SpanishScene4.iso
/
Programas
/
EsteveBoix_Ind
/
tablePlugv12.lha
/
tablePlug12
/
rx
/
img_studio.tpx
< prev
next >
Wrap
Text File
|
1999-09-25
|
963b
|
60 lines
/*
img_studio.tpx v1.0 © 1999 Dave Naylor
Uses ImageStudio to load the images and scale them down.
This tpx uses the ImageStudio internal loaders.
Tested with ImageStudio 2.3.
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 'IMAGESTUDIO'
OPEN '"'infile'"' FORCE
/* Obtain info about the image */
IMAGEINFO_GET STEM IMAGE.
x = IMAGE.width
y = IMAGE.height
/* ...and calculate the thumbnail resolution */
comp=trunc((maxsizex/x)*y)
if comp<=maxsizey then do
SCALE maxsizex comp
end
else do
/* No */
comp2=trunc((maxsizey/y)*x)
SCALE comp2 maxsizey
end
/* And save the image */
SAVE FILE '"'outfile'"' FORMAT "JPEG" ARGS '"QUALITY 'compression'"'