The following script uses ImageMagic to convert files to bmp format. Only trouble is that it does not convert .webp images.
Any suggestions as to how to do it inside my Script?
log_text = ""
list_bmp = filefind.get(filename_decode("[DL]*.bmp"),0,"n")
list_png = filefind.get(filename_decode("[DL]*.png"),0,"n")
list_jpg = filefind.get(filename_decode("[DL]*.jpg"),0,"n")
list_jpeg = filefind.get(filename_decode("[DL]*.jpeg"),0,"n")
list_gif = filefind.get(filename_decode("[DL]*.gif"),0,"n")
list_webp = filefind.get(filename_decode("[DL]*.webp"),0,"n")
list_svg = filefind.get(filename_decode("[DL]*.svg"),0,"n")
Img_list = list_bmp+crlf()+list_png+crlf()+list_jpg+crlf()+list_gif+crlf()+list_jpeg+crlf()+list_webp+crlf()+list_svg
for each fn in Img_list
if (regex_match(substr(fn,1,8),"[A-Z][0-9]{7}","egi") .or. regex_match(substr(fn,1,8),"[A-Z]{2}[0-9]{6}","egi"))
folder = word(file.filename_parse(fn,"n"),-1,"_")
from = filename_decode("[dl]"-fn)
tooo = filename_decode("["+folder+"]")-file.filename_parse(fn,"dpn")-".bmp"
done = filename_decode("[done]"-fn)
pResult = a5_runImageMagicCommand(from,tooo,"")
file.copy(from,done)
file.remove(from)
Log_text = Log_text+file.filename_parse(tooo,"ne")+" Copied to Folder <"+ut(Folder)+"> "+if(pResult.hasError,pResult.errorText,"")+crlf()
end if
next
if Log_text = "" then
Log_text = "Nothing found to copy"
else
sortsubstr(Log_text,crlf(),"A")
end if
ui_msg_box("Copy Graphic Results (Total "+*count(Log_text)+")",log_text,UI_Information_SYMBOL)
thanks
Any suggestions as to how to do it inside my Script?
log_text = ""
list_bmp = filefind.get(filename_decode("[DL]*.bmp"),0,"n")
list_png = filefind.get(filename_decode("[DL]*.png"),0,"n")
list_jpg = filefind.get(filename_decode("[DL]*.jpg"),0,"n")
list_jpeg = filefind.get(filename_decode("[DL]*.jpeg"),0,"n")
list_gif = filefind.get(filename_decode("[DL]*.gif"),0,"n")
list_webp = filefind.get(filename_decode("[DL]*.webp"),0,"n")
list_svg = filefind.get(filename_decode("[DL]*.svg"),0,"n")
Img_list = list_bmp+crlf()+list_png+crlf()+list_jpg+crlf()+list_gif+crlf()+list_jpeg+crlf()+list_webp+crlf()+list_svg
for each fn in Img_list
if (regex_match(substr(fn,1,8),"[A-Z][0-9]{7}","egi") .or. regex_match(substr(fn,1,8),"[A-Z]{2}[0-9]{6}","egi"))
folder = word(file.filename_parse(fn,"n"),-1,"_")
from = filename_decode("[dl]"-fn)
tooo = filename_decode("["+folder+"]")-file.filename_parse(fn,"dpn")-".bmp"
done = filename_decode("[done]"-fn)
pResult = a5_runImageMagicCommand(from,tooo,"")
file.copy(from,done)
file.remove(from)
Log_text = Log_text+file.filename_parse(tooo,"ne")+" Copied to Folder <"+ut(Folder)+"> "+if(pResult.hasError,pResult.errorText,"")+crlf()
end if
next
if Log_text = "" then
Log_text = "Nothing found to copy"
else
sortsubstr(Log_text,crlf(),"A")
end if
ui_msg_box("Copy Graphic Results (Total "+*count(Log_text)+")",log_text,UI_Information_SYMBOL)
thanks
Comment