Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Problema con Image Resizer e AspImage

    Ciao a tutti
    devo ridimenzionare delle immagini e salvarle su un server con windows server 2003.
    Ho provato sia con Image Resizer e sia con AspImage:

    Image Resizer

    'Resize delle immagini
    Sub ResizeImage(PathOriginal, PathDestination, Width, Height)
    dim xml, strImagerDLL, bData, FileName

    strImagerDLL = "http://www.MIOSITO.com/cgi-bin/Imager.dll"
    Set xml = Server.CreateObject("Microsoft.XMLHTTP")

    xml.Open "POST", strImagerDLL & "?Image=" & PathOriginal & "&Width=" & Width & "&Height=" & Height, False

    xml.Send()
    bData = xml.ResponseBody
    Set xml = nothing

    dim oStream
    Set oStream = Server.CreateObject("ADODB.Stream")

    oStream.type = 1
    oStream.mode = 3
    oStream.open
    oStream.write bData
    oStream.Position = 0

    oStream.SaveToFile PathDestination

    oStream.Close
    Set oStream = Nothing
    End Sub

    Non esegue SaveToFile

    AspImage

    'Resize delle immagini
    Sub ResizeImage(PathOriginal, PathDestination, Width, Height)
    ' Dimensiono le variabili
    Dim myImg, w, h, maxw, maxh, myw, myh

    ' Creo l'oggetto
    Set myImg = Server.CreateObject("AspImage.Image")

    ' Carico l'immagine originale (da ridimensionare)
    myImg.LoadImage PathOriginal

    ' Faccio un po' di calcoli per individuare il rapporto da utilizzare nel processo di miniaturizzazione
    myw = Width
    myh = (myImg.MaxY *Cint(Width))/myImg.MaxX

    ' Utilizzo il metodo resizer specificando larghezza e altezza
    myImg.ResizeR myw, myh

    ' Salviamo il tutto indicando il percorso fisico ed il nome del nuovo file
    myImg.FileName = PathDestination

    if myImg.SaveImage then
    Response.Write "[img][/img]"
    else
    Response.Write "Si è verificato un errore!"
    end if
    ' Faccio pulizia
    Set myImg = nothing
    End Sub

    Non accade nulla quando esegue if myImg.SaveImage then

    Ho provato a mettere dei response.write dopo SaveToFile e SaveImage, ma non vengono eseguiti.

    QUALCUNO PUO' AIUTARMI? ALTRI PROGRAMMI CHE POSSSO USARE?

  2. #2
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    Personalmente utilizzo una libreria dll che va registrata e mi trovo benissimo
    Il suo nome è SImageUtil

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.