Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
60K Images
#1
Ok...so this works an every photo I've test except on 1 photo. It just keeps taking one off the quality until it gets down to zero.

Function Resize60K
Code:
Copy      Help
;/EXE
ARRAY(str) a
tok _command a -1 " ''" 4
if a.len=0
,ret
str ToDay.timeformat("{yyyy}-{MM}-{dd}")

for int'i 0 a.len
,str sPath=a[i]
,out sPath
,str Sizes=
,;450
,;228
,;160
,;75
,for int'ii 0 numlines(Sizes)
,,int SKIP=0
,,str Size.getl(Sizes ii)
,,int W=val(Size)
,,double Q=100
,,double C=24
,,sPath.expandpath
,,str Directory=F"$desktop$\60K\{ToDay}"
,,mkdir Directory
,,str nPath.getfilename(sPath)
,,nPath=F"{Directory}\{nPath}_{W}.jpg"
,,nPath.expandpath
,,;BUFFER
,,str cl=
,,F
,,;"{sPath}"
,,;/dpi=(72,72)
,,;/resize=({W},0)
,,;/resample
,,;/aspectratio
,,;/jpgq={Q}
,,;/convert="{nPath}"
,,cl.findreplace("[]" " ")
,,out cl
,,run "C:\irfanview\i_view32.exe" cl "" "" 0x400
,,nPath.findreplace(".png" ".jpg")
,,if Q>1
,,,Dir d
,,,if d.dir(nPath 0)
,,,,long nSize=d.FileSize
,,,,if nSize>=61440
,,,,,Q-1
,,,,,C-1
,,,,,out Q
,,,,,out nSize
,,,,,out "==============="
,,,,,goto BUFFER
run Directory

I was wondering if I could scale the image down to 450px using IrfanView and then call http://luci.criosweb.ro/riot/dll-version/ to reduce file size down to 60K.
The RIOT DLL is able to run in Irfanview on the image just fine. Of course there is no way to manipulate plugins through the irfanview command line.

Perhaps there is something that has a command line that will work for this better.

Thanks,
Jim


Forum Jump:


Users browsing this thread: 1 Guest(s)