'REQUEST "VisualBorderDemo.rexx is missing!" "Sorry"'
end
PROJECT_LIST
xyz=result
newpic=subword(xyz,1,1)
CLOSE newfile
/* SAVE FILE */
lastp=lastpos(".",file)
if lastp ~== "0" then do
oldsuffix=right(file,length(file)-lastp)
basename=left(file,lastp-1)
end
else basename=strip(substr(file,1,27),B," ")
select
when upper(oldsuffix) == "JPG" | upper(oldsuffix) == "JPEG" | upper(oldsuffix) == "JFIF" then do
filetype="JPEG (IJG-JFIF)"
suffix=".jpg"
end
when upper(oldsuffix) == "PNG" upper(oldsuffix) == "PING" then do
filetype="PNG (PiNG)"
suffix=".png"
end
when upper(oldsuffix) == "TGA" | upper(oldsuffix) == "TARGA" then do
filetype="Targa (TGA)"
suffix=".tga"
end
when upper(oldsuffix) == "TIF" | upper(oldsuffix) == "TIFF" then do
filetype="TIFF V5.0"
suffix=".tif"
end
otherwise do
filetype="JPEG (IJG-JFIF)"
suffix=".jpg"
end
end
endpart=right(sourcedir,1)
if endpart~=":" & endpart~="/" then sourcedir=sourcedir||"/"
newdir="processed/"
fullpath=sourcedir||newdir||basename||suffix
SAVE_DATA newpic '"'fullpath'"' '"'filetype'"'
CLOSE newpic
exit
error:
if RC=5 then do
IE_TO_FRONT
LAST_ERROR
'REQUEST "'||RESULT||'"'
exit
end
else do
IE_TO_FRONT
LAST_ERROR
'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'