home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
util
/
dosreqtools.lha
/
DOSReqTools
/
demo.ext
< prev
next >
Wrap
Text File
|
1994-11-26
|
3KB
|
114 lines
;demo.ext
; Requires DJPEG (v5) from AmiNet gfx/conv/jpegv5.bin.lha
; a viewer like ViewTek
; DOSReqtools
; CONVERTS JPEGS TO GIFS
FAILAT 21
LAB START
;---------------------
; SET UP THE SOURCE AND DEST. DIRECTORIES
;---------------------
SETENV sourcedrawer Work:graphics/pictures/JPEG/gals
;SETENV destdrawer Work:graphics/pictures/GIF
SETENV destdrawer ram:temp
;---------------------
; GET A JPEG FILENAME TO CONVERT
;---------------------
rtFileRequest "Convert a JPEG to a GIF" DRAWER $sourcedrawer TO ENV:source
SET result $RC
;---------------------
; TEST IF QUIT WAS SELECTED
;---------------------
IF $Result eq 0
SKIP SHUTDOWN
ENDIF
;---------------------
; SPLIT THE SOURCE PATH/FILENAME INTO TWO PARTS
;---------------------
PathPart >ENV:sourcepath $source
FilePart >ENV:sourcename $source
;---------------------
; SELECT THE DESTINATION DIRECTORY TO WRITE THE GIF
;---------------------
rtFileRequest "Convert to Grayscale, Half Size" DRAWER $destdrawer NOFILES TO ENV:targetdir
;---------------------
; TAKE THE ROOT FILENAME (XXX.JPG) AND ASSIGN IT TO A
; NEW VARIABLE SO THAT LATER WE CAN CHANGE THE EXTENSION
;---------------------
SETENV targetname $sourcename
;---------------------
; CHANGE THE EXTENSION FROM .JPG TO .GIF AND RETAIN THE ROOT NAME
;---------------------
ChangeExt >env:tempname $targetname ".gif"
;---------------------
; COPY THE NEW NAME BACK AS $TARGETNAME
;---------------------
SETENV targetname $tempname
;---------------------
; COPY THE TARGET DIRECTORY BACK TO $DESTINATION
;---------------------
SETENV destination $targetdir
;---------------------
; MERGE THE DESTINATION PATH WITH THE NEW FILENAME (XXX.GIF)
; AND PUT IT IN $TEMPNAME
;---------------------
Addpart >env:tempname $destination $targetname
;---------------------
; COPY THE NEW DESTINATION BACK TO $DESTINATION
;---------------------
SETENV destination $tempname
;---------------------
; CALL DGPEG FOR THE CONVERSION
; MAKE THE OUTFILE 1/2 HALF SIZE AND GRAYSCALE
;---------------------
djpeg -gr -gif -scale 1/2 $source $destination
;---------------------
; LOOK AT THE GIF WITH VIEWTEK
;---------------------
vt $destination
SKIP BACK START
LAB SHUTDOWN
DELETE ENV:SOURCE
DELETE ENV:SOURCEDRAWER
DELETE ENV:SOURCEPATH
DELETE ENV:SOURCENAME
DELETE ENV:TARGETDIR
DELETE ENV:TARGETNAME
DELETE ENV:TEMPNAME
DELETE ENV:DESTINATION
quit