I have been working on a project where I am compressing jpeg images to .lep format. Now, I have created an .exe file that can convert the .lep image back to jpeg. My goal is to write a simple JSP script that can decode the .lep image on-the-fly and display it in the web browser. The code snippet below currently works only in Internet Explorer.
<html>
<head>
<script type="text/javascript">
function bar() {
console.log("Testing");
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec("D:\lepton.exe D:\img.lep");
var strOutput = oExec.StdOut.ReadAll();
console.log(strOutput);
document.getElementById("img1").src = "D:\img.jpg";
}
</script>
</head>
<body>
<button onclick="bar()">Click me</button>
<img id="img1" alt="Smiley face" >
</body>
</html>