Public Sub jpeg2webp(dir As String ,fn As String)
Dim shl As Shell
' call convert doing resize
Dim fullpath As String = File.Combine(dir,fn)
shl.Initialize("shl", File.DirApp &"\cwebp.exe", Array As String("-resize","0","750",fullpath, "-o",fullpath.SubString2(0,fullpath.Length-4) & "webp"))
shl.WorkingDirectory = File.dirapp
shl.Run(-1)
wait for shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
If Not(Success) Then
Log(StdErr )
End If
End Sub