Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

anyone using ASPJPEG?

Status
Not open for further replies.

etjohnson81

Programmer
Jul 17, 2006
72
US
Its doing nothing for me....

Code:
 Set Jpeg = Server.CreateObject("Persits.Jpeg")

' Open source image
myfile = server.mappath("logo1.jpg")
Jpeg.Open myfile 

' New width
L = 100

' Resize, preserve aspect ratio
Jpeg.Width = 10
Jpeg.Height = 10

' create thumbnail and save it to disk
Jpeg.Save server.MapPath("testfile.jpg")
response.write(myfile)
 
Basically your just writing the location of the original file to the page as text. I assume you're trying to right the new file as an image on the page. You must use an '<img />' element with the actual URL for this. You cannot use the physical paths within HTML links/elements.

Your exact script works fine for me with the following adjustments:

Code:
     Set Jpeg = Server.CreateObject("Persits.Jpeg")

    ' Open source image
    myfile = server.mappath("logo1.jpg")
    Jpeg.Open myfile

    ' New width
    L = 100

    ' Resize, preserve aspect ratio
    Jpeg.Width = 10
    Jpeg.Height = 10

    ' create thumbnail and save it to disk
    [b]Jpeg.Save server.MapPath("\DirForFileSave\") & "testfile.jpg"
    response.write("<img src="""[URL unfurl="true"]http://www.YOURSITE.com/DirForFileSave/testfile.jpg"""[/URL] />")[/b]
 
It came down to the fact that I had to change a few folder permissions, close and reopen the site.

The response.write was just there for debugging purposes.

Thanks though.
 
Ah, yes. I was going to mention that but it was getting late for me and I lost my text a few times when entering my response.

For security, I would recommend not enabling read/write/execute permissions on the same physical directory. My host uses a virtual /files/ directory to enable write permissions from script, and if I need to write to another directory from script I use a special directory with a second NT account to allow this. This forces a login to be required before you can execute script and write to other directories.

Just FYI.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top