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 2 of 2 (28 items) < Previous 1 2
Sort Posts: Previous Next
  • 04-07-2004 2:57 AM In reply to

    • jwrog
    • Not Ranked
    • Joined on 04-07-2004
    • New Member
    • Points 5

    Retrieving Remote Image Properties is ASP

    I used the "getsize" script on a shared web server, that I believe had Windows 2000 server on it, and it worked great.  I then moved to a dedicated server that had Windows 2003 server on it and suddenly the script didn't work.  No errors occured, it's just that I was not able to assertain the image properties anymore.  Basically it can't identify the file type for some reason, and therefore can't return the image width and height.  Would you know any reason why the getsize script would not work the same on a Windows 2003 server?
    • 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.

  • 08-17-2004 1:58 PM In reply to

    Any luck?

    Have you had any luck in getting this script to work?

    I am trying to fit this script into an asp.net page, and I am not able to make it function either.  I was wondering if you were able to get it too work?

    • Post Points: 0
  • 09-08-2004 12:10 AM In reply to

    • asuka08
    • Not Ranked
    • Joined on 09-08-2004
    • New Member
    • Points 10

    Good function!

    Good function! Thank you for share!
    • Post Points: 0
  • 09-08-2004 12:19 AM In reply to

    • asuka08
    • Not Ranked
    • Joined on 09-08-2004
    • New Member
    • Points 10
    Quote:
    [1]Posted by aprida on 24 Jun 2003 02:25 AM[/1]
    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?



    yes,it can deal with local image file, use it like this:
    aa = getSize( Server.MapPath("emblem/chidori.gif"), width, height, depth, flType )
    • Post Points: 0
  • 09-30-2004 5:43 AM In reply to

    • singh_rj
    • Not Ranked
    • Joined on 09-30-2004
    • New Member
    • Points 20

    msxml3.dll error '800c0005'

    It works on our local test server but it is not working on our web server
    and it's show the error msxml3.dll error '800c0005'.
    if any body have any solution for this then plz mail me.
    • Post Points: 0
  • 10-26-2004 1:53 AM In reply to

    • dallucha
    • Not Ranked
    • Joined on 10-25-2004
    • New Member
    • Points 5

    Good Function

    Thanks, I have been trying to do this from many days. This has help me a lot. Once again thank you very much.
    • Post Points: 0
  • 03-29-2005 5:45 PM In reply to

    Possibly a solution

    Singh,

    I know this post is almost 6 months old, but as your listing is first in Google, I thought I would respond with what solved this problem for me.  I believe my issue was some kind of DNS / Firewall issue.  I was using http://www.mydomain.com/thefileforxmlparsertoget.asp.  However, when I logged into my server and tried to get to that page, I couldn't.  I could get to it from my own machine, but not from the server.  It was not until I used my internal 192.168 address (private internal address) of the web server that I actually got my script to work.  So, instead of using my domain, I used http://192.168.1.1/thefileforthexmlparsertoget.asp.  I hope that helps.  If you think about it, it makes sense.  The XML script is running server side in my script, so therefore, the SERVER is actually making the call, not the client.

    I doubt that helps any, but it sure solved my problem after about an hour or two of digging.
    • Post Points: 0
  • 03-31-2005 9:17 AM In reply to

    • singh_rj
    • Not Ranked
    • Joined on 09-30-2004
    • New Member
    • Points 20

    Thanks

    Dear stoneman,

    Thanks a lot.

    Regards,
    Ram Janm Singh
    Chetu Inc.
    Ph: +91 120-3946734 - outside US
    Ph: +1 (305) 402 6724 - within US
    Fax: +1 305 832 5987
    Mb: +91 9868 567 152
    For more information, please visit: http://www.chetu.com
    • Post Points: 0
  • 04-16-2005 7:17 AM In reply to

    • michail1
    • Not Ranked
    • Joined on 04-16-2005
    • New Member
    • Points 5

    800c0005

    Been searching on this for days.

    I am confirming that is has something to do with a firewall.

    I have access to 4 servers.  2 running Windows 2000 SBS (small business server) with ISA firewall - 2 nics.     2 servers with regular 2000 server.

    The 2 with 2k server run great.  No problems.
    The 2 with SBS both have problems giving the c0005 error.
    If you run your ASP page to do your request within the server, then it works.  Not externally though.  The error is always at the .send command.

    Traxxas Revo T-Maxx Parts TMaxx Store
    • Post Points: 0
  • 05-24-2005 2:04 PM In reply to

    Using the aspect ratio makes the job easier.

    I adapted some code I used so it used the same style and variable names as your code.
    The idea of this code is to make sure the image will fit within a max rectangle and keep the image's aspect ratio the same. Also it prevents divide by zero errors if the image dimensions are unknown and rounds the new height and width to the nearest pixel instead of the next smaller pixel.
    The code can be made to scale up smaller images to fit the max ractangle as well by replacing the following line with the one just below it. Great for thumbnail images!
    If theWidth>=1 and theHeight >=1 and (theWidth>maxwt or theHeight>maxht) then
    If theWidth>=1 and theHeight >=1 then


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

    If theWidth>=1 and theHeight >=1 and (theWidth>maxwt or theHeight>maxht) then
    theAspect=theHeight/theWidth
    If theAspect>maxaspect then
    'Image has taller aspect ratio than max rectangle
    imght=maxht
    imgwt=int(maxht/theAspect+.5)
    Else
    'Image has wider aspect ratio than max rectangle
    imght=int(maxwt*theAspect+.5)
    imgwt=maxwt
    End If
    Else
    'Image has either no width or no height or fits within max rectangle
    imght=theHeight
    imgwt=theWidth
    End If
    %>
    <img src="<%=theURL%>" height="<%=imght%>" width="<%=imgwt%>" />
    • Post Points: 0
  • 07-25-2005 12:17 PM In reply to

    • shem
    • Not Ranked
    • Joined on 07-25-2005
    • New Member
    • Points 45
    Howzit

    i'm new to asp, i tried to apply the code, now my pictures do not display at all?

    do u need a component to run this code or issit asp.net?

    thanks
    • Post Points: 0
  • 07-25-2005 7:18 PM In reply to

    BoundImage function

    Don't forget to set theHeight, theWidth, and theURL before running this code.
    I styled it based on the first post. Since it was assumed the variables were set before running this code, I did the same. If you are displaying an image that you don't know the height and width ahead of time you can use a component to find out what dimensions are. ImageSize component available at http://www.serverobjects.com/products.htm is commonly used and it's free!

    If you neglected to set the height and width of the original image, my code will generate something like the following...

    <img src="theImage.jpg" height="" width="" />

    Internet Explorer displays a 0px X 0px graphic which can't be seen.


    Better yet try this fucntion...
    <%'----Function to scale an image to fit------
    Function ImageBound(theURL,maxht,maxwt,scaleup)
       'maxht - max height of image
       'maxwt - max width of image
       'scaleup - False only scales down large images. True also scales up small images.
       '        Note: When set to false the function only scales down images that are oversized.
       '            True resizes all images to fit within the available rectangle with aspect retained.
       'theURL - The relative URL of the image.
       'You must have the ImageSize component installed for this to work.
       'http://www.serverobjects.com/products.htm
       set Img = Server.CreateObject("ImgSize.Check")
       Img.FileName = Server.MapPath(theURL)
       if Img.Error <> "" then
           Response.Write "An error occurred in processing this image.<br>"
           Response.Write "The error was: <b>" & Img.Error & "</b>"
       else
           theHeight=Img.Height
           theWidth=Img.Width
           maxaspect=maxht/maxwt 'aspect ratio of max rectangle
           If theWidth>=1 and theHeight >=1 and ((theWidth>maxwt or theHeight>maxht) or scaleup) then
               theAspect=theHeight/theWidth
               If theAspect>maxaspect then
                   'Image has taller aspect ratio than max rectangle
                   imght=maxht
                   imgwt=int(maxht/theAspect+.5)
               Else
                   'Image has wider aspect ratio than max rectangle
                   imght=int(maxwt*theAspect+.5)
                   imgwt=maxwt
               End If
           Else
               'Image has either no width or no height or fits within max rectangle
               imght=theHeight
               imgwt=theWidth
           End If
       end if
       ImageBound= "<img src=""" & theURL & """ height=""" & imght & """ width=""" & imgwt & """ />"
       set Img = nothing
    End Function

    response.write ImageBound("/images/image.jpg",50,75,True)
    response.write ImageBound("/images/image.jpg",50,75,False)
    %>
    • Post Points: 0
  • 09-07-2005 2:31 PM In reply to

    • Youk88
    • Not Ranked
    • Joined on 09-07-2005
    • New Member
    • Points 5

    Save file from url in asp

    Hi,

    I wrote a code to save on my site a file from an URL in ASP. You can save an image (jpg,gif,...) or another binary file.

    The code is here : http://www.eromandie.com/codesource/asp/save_file_from_url.asp

    Regards

    Youk88
    • Post Points: 0
Page 2 of 2 (28 items) < Previous 1 2