Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[1971] Retrieving Remote Image Properties in ASP

Last post 09-07-2005 2:31 PM by Youk88. 27 replies.
Page 1 of 2 (28 items) 1 2 Next >
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [1971] Retrieving Remote Image Properties in ASP

    This thread is for discussions of Retrieving Remote Image Properties in ASP.

    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 11-21-2002 5:28 PM In reply to

    • cascoly
    • Not Ranked
    • Joined on 11-21-2002
    • New Member
    • Points 15

    great help!

    Excellent code -- i'd been struggling with the original code and had a problem opening and reading the image files -- i swapped in this code and my routines ran the first time.

    My travel pages contain hundreds of images and i need a quick way to add new images and display them across many different pages.   so i wrote a routine that lets the user decide whether to display in thumbnail, caption only, or full size.  until now, i didnt have an easy way of knowing the format, so i had to encode whether the image was horizontal or vertical -- now it works as it should, and will allow me to scale images in all fomats, too.  

    to see a sample of this in action:

    http://cascoly.com/trav/turkey/Konya.asp

    thanks
    steve
    • Post Points: 0
  • 01-14-2003 5:27 AM In reply to

    • flummi
    • Not Ranked
    • Joined on 01-14-2003
    • New Member
    • Points 5
    I'm struggling with the original code, too.
    Especially the line:

    - obj.open "GET", URL, False

    returns the error: invalid procedure call.

    Could you please print your changes you made to make the code run?

    Thanx a lot,
    Flummi
    • Post Points: 0
  • 02-04-2003 1:01 PM In reply to

    • spanno
    • Not Ranked
    • Joined on 02-04-2003
    • New Member
    • Points 10

    progressive file check

    I have an ASP based content control utility with around 30 editors each usnig the system.  We have a flash application that only takes in non-progressive images dynamically.  I need to ensure that when an editor uploads a new image to our server it's in the non-progressive format.  I looked over your code brriefly and noticed that you were checking bytes from the file to gather information about it.  What byte information could I grab to check to see if the file's progressive or not?
    • Post Points: 0
  • 02-04-2003 11:00 PM In reply to

    • jsangst
    • Not Ranked
    • Joined on 02-04-2003
    • New Member
    • Points 5

    Great piece of code

    I used this in its original form, but this is a better version.  Has anyone ever converted this the Javascript?
    • Post Points: 0
  • 04-09-2003 4:19 PM In reply to

    Great script!

    This is great! Ive been looking for something like this for weeks! Thanks
    But is there a way to get the size of the file? Purhaps in KBs? Thanks!
    • Post Points: 0
  • 04-18-2003 6:21 PM In reply to

    I have the same problem

    Hi Spanno;
    - - I'm dealing with this same issue. I have developed a self-administrated flash photo gallery which accepts user-uploaded jpgs via an ASP server-side upload component (saFileUp). Unfortunately, some people are uploading progressive jpgs, which then do not show up in the flash interface. I DO have a COM object from SoftArtisans (ImgWriter), which can re-save JPG's in non-progressive format. The problem is, I have no way of determining (reading) the progressive property. Thus, I would have to indiscriminately re-save all jpgs as non-progressive, without knowing whether they were progressive to begin with. This results in the re-compression of existing jpgs and the consequent loss of image quality. Plus, the imgWriter's compression algorithm is not very good, and it often results in a larger file size for a poorer quality image. I was hoping someone might know of how I can read the progressive property at upload time and then I can either reject the file or auto-re-save it with the progessive property set to false.

    Let me know if you figured this one out spanno! I will also re-post here if I can solve this...
    • Post Points: 0
  • 05-22-2003 3:38 AM In reply to

    • aprida
    • Not Ranked
    • Joined on 05-22-2003
    • New Member
    • Points 30

    I can't use the script

    How to use this script ?
    I'm newbie in ASP.
    Can anyone tell me how to display the output of the width and height of the images?
    Let say I have a jpg file, picture.jpg, and I store it in root directory of my web folder.
    What command must I add to display the width and height of picture.jpg ?
    Response.Write blablabla bla?
    • Post Points: 0
  • 06-23-2003 12:15 PM In reply to

    • salmo
    • Not Ranked
    • Joined on 06-23-2003
    • New Member
    • Points 10
    Hey y'all, I've just astounded myself by being able to use this peice o' code, so I thought I'd share it with you.
    The code below calls the function and print the results.

    Salmo xxx

    <%
    dim theURL, theWidth, theHeight, theDepth, theFlType, blnImageStuff
    theURL = "http://www.notongues.com/flyer.jpg"
    theWidth = 0
    theHeight = 0
    theDepth = 0
    theFlType = ""

    blnImageStuff = getSize(theURL, theWidth, theHeight, theDepth, theFlType)

    if blnImageStuff then
       response.Write(theWidth & "<br>")
       response.Write(theHeight & "<br>")
       response.Write(theDepth & "<br>")
       response.Write(theFlType & "<br>")
    else
       response.Write("Hmm, that didn't seem to work...")
    end if
    %>
    • Post Points: 0
  • 06-24-2003 2:25 AM In reply to

    • aprida
    • Not Ranked
    • Joined on 05-22-2003
    • New Member
    • Points 30

    Can I change the URL with path?

    Thanks for the code
    I've been waiting it for so long. It takes 1 month to get the reply.

    Can I change the URL with the path such as /image ??
    I find it becomes very slow for the script to be run if I use the complete URL like http://...
    I place the image file in one folder inside the folder where I put the script. And probably it will be faster if I change URL with the path.
    If I can change it, what is the command?
    • Post Points: 0
  • 06-24-2003 6:22 AM In reply to

    • salmo
    • Not Ranked
    • Joined on 06-23-2003
    • New Member
    • Points 10

    'fraid not

    I think the script uses the HTTP headers to acertain certain stuff, which would be information which would have to be come by another way with a file sitting on your server, so in short, no. It's well beyond me powers. soz

    salmo xxx
    • Post Points: 0
  • 10-02-2003 6:35 AM In reply to

    • darioj
    • Not Ranked
    • Joined on 10-02-2003
    • New Member
    • Points 10

    Not same thing but ...

    Hi,

    I needed a way to find width and height of an image and came up with this script. I use loadpicture vbscript function to get image dimensions. The OS will return dimensions in metric scale (cm/1000). Windows screen res. is 96 dots per inch. 1 inch is 2.54 cm.
    2.54/96*1000 = 26.4583

    I know that the script above scales images but if you just need image dimensions this works fine. You can also get the type, handle, and palette of the image. Props are on msdn: click here

    Code:

    <%
    dim iWidth, iHeight, iType
    sub ImgDimension(img)
       dim myImg, fs
       Set fs= CreateObject("Scripting.FileSystemObject")
       if not fs.fileExists(img) then exit sub
       set myImg = loadpicture(img)
       iWidth = round(myImg.width / 26.4583)
       iHeight = round(myImg.height / 26.4583)
       iType = myImg.Type
       select case iType
       case 0
           iType = "None"
       case 1
           iType = "Bitmap"
       case 2
           iType = "Metafile"
       case 3
           iType = "Icon"
       case 4
           iType = "Win32-enhanced metafile"
       end select
       set myImg = nothing
    end sub

    ' so if you whant to test it in asp just give the path to your image
    ImgDimension(Server.MapPath("../.") & "\images\uc.gif")

    response.write("Dimensions: " & iWidth & " x " & iHeight & "<br>")
    response.write("Image Type: " & iType & "<br>")
    %>



    • Post Points: 0
  • 10-10-2003 1:01 AM In reply to

    • sefrank
    • Not Ranked
    • Joined on 10-10-2003
    • New Member
    • Points 15

    Scaling an image

    I created this code to scale an image to fit in a fixed space.  Does anyone know a shorter script that will work?

    <%'----routine to scale image if it is too big------
    maxht = 50 'max height of image
    maxwt = 130 'max width of image

    If theHeight > maxht AND theWidth > maxwt then
    imgfactor = theHeight / maxht
    imght = int(theHeight / imgfactor)
    imgwt = int(theWidth / imgfactor)
    End If

    If theWidth > maxwt AND theHeight < maxwt then
    imgfactor = theWidth / maxwt
    imght = int(imght / imgfactor)
    imgwt = int(theWidth / imgfactor)
    End If

    If theHeight > maxwt AND theWidth < maxwt then
    imgfactor = theHeight / maxht
    imght = int(theHeight / imgfactor)
    imgwt = int(imgwt / imgfactor)
    End If
    %>
    <img src="<%=theURL%>" height="<%=imght%>" width="<%=imgwt%>" />
    • Post Points: 0
  • 10-17-2003 12:22 AM In reply to

    • duh
    • Not Ranked
    • Joined on 10-17-2003
    • New Member
    • Points 10

    Thanks for handy code!!!!!

    Geez, I wasted hours and hours trying to find a script that does what you have posted here. I need something for which I could get the dimensions of one specific image (filename passed to the script by a querystring) and then use querystrings and redirects to enter the dimensions into Access database fields!!!!!!!!

    Thank you, thank you!!!!!!!!!!!!!!!!!!!!!!!!!!
    • Post Points: 0
  • 10-17-2003 4:08 PM In reply to

    • duh
    • Not Ranked
    • Joined on 10-17-2003
    • New Member
    • Points 10

    Tutorial using daroj's script

    • Post Points: 0
Page 1 of 2 (28 items) 1 2 Next >