I am using aspupload and aspjpeg to upload an image, resize to 500px width (with relative height).
The image is uploading fine but isn`t getting resized. I have had a reply from Persists who make aspjpeg and they said my code looks fine.
Can someone have a look please?
Many thanks
Code:<html><head><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <style type="text/css"> <!-- #loading { width: 200px; height: 100px; background-color: #c0c0c0; position: absolute; left: 50%; top: 50%; margin-top: -50px; margin-left: -100px; text-align: center; } --> </style> <script type="text/javascript"> <!-- Begin document.write('<div id="loading"><br><br>Please wait...</div>'); window.onload=function(){ document.getElementById("loading").style.display="none"; } // End --> </script> </head> <body > <% Set Upload = Server.CreateObject("Persits.Upload.1") path = Server.MapPath("/images/products/") Count = Upload.Save(Path) Set File = Upload.Files("FILE1") ' Create instance of AspJpeg Set Jpeg = Server.CreateObject("Persits.Jpeg") ' Open source image jpeg.Open( File.Path ) ' New width W = 500 ' Resize, preserve aspect ratio Jpeg.Width = W Jpeg.Height = Jpeg.OriginalHeight * W / Jpeg.OriginalWidth ' create thumbnail and save it to disk SavePath = Path & File.ExtractFileName ' AspJpeg always generates thumbnails in JPEG format. ' If the original file was not a JPEG, append .JPG ext. If UCase(Right(SavePath, 3)) <> "JPG" Then SavePath = SavePath & ".jpg" End If jpeg.Save SavePath response.write "You may now close this window" %> </body> </html>


Reply With Quote

Bookmarks