ASP.net resize image from external domain

Hi, i'm looking for a way to code a page in ASP.NET so that you can stick an image location in the querystring, for example

"blah.asx?image=http://www.google.com/images/logo.gif" and page will become the image - but resize it first if that makes sense

so if i created an image on a webpage, using the basic img tag, <img src="blah.asx?image=http://www.google.com/images/logo.gif"> It would show the image in the querystring, but resize the image on the fly, to a max proportion i set within the asx file keeping the aspect ratios). Can anyone point me in the right direction for doing this, or find me the code to do this

Thanks very much

SP!KE
spikehalliwellAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sybeCommented:
Why not simply:

<img src="blah.asx?image=http://www.google.com/images/logo.gif" width="30" height="30">

then the browser will do the resizing, save you a lot of work.
spikehalliwellAuthor Commented:
HUGE files not thumbnailed would cause a lot of bandwidth and slow user access to my pages by a lot
sybeCommented:
i don't know about dotnet, but plain asp can't resize images on the fly, you need a component for that. There are some available, but the good ones will cost you some money.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

spikehalliwellAuthor Commented:
i believe ASP.NET can handle images without componants - it can certainly thumbnail images - i'm just not sure of the code which is why i'm asking on here
spikehalliwellAuthor Commented:
i'm fairly sure ASP.net can cope with image resizing - its one of the new features - it can certainly create thumbnails on the fly -though i think they might be from local files - i'm just not sure of the code- which is why i'm posting on here
sybeCommented:
Have you thought about copyright issues? You probably can't "steal" an image from another website and process it and offer it to your customers..
spikehalliwellAuthor Commented:
google was an example - its a function on one of my sites to add a URL with their profile image on it - which means they must own the copyright of their image - and there is a disclaimer to that effect - so its not stealing
fritz_the_blankCommented:
Perhaps this:

http://www.eggheadcafe.com/articles/20030515.asp

You will just have to replace the path from something local to your remote path.


FtB
fritz_the_blankCommented:
BTW, please be sure to finalize your question at:

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20732287.html

FtB
fritz_the_blankCommented:
spikehalliwellAuthor Commented:
these are all helpful but don't really solve my origional question - how do i resize an image not hosted on my local domain??
fritz_the_blankCommented:
It seems to me that a place to start would be to try passing the external url as a parameter for the physical path to this method.....

public void GenerateThumbNail(string sPhysicalPath,string sOrgFileName,string sThumbNailFileName,ImageFormat oFormat)
spikehalliwellAuthor Commented:
i don't want to go down this route until i'm sure it will work
fritz_the_blankCommented:
I see. So you are suggesting perhaps that I should test all of this and get back to you?

FtB
spikehalliwellAuthor Commented:
no that would be much to much work - it would just be easier if someone could say - yes you can definatly thumbnail images that aren't located on your domain
fritz_the_blankCommented:
I am guessing that you will have to get the image from the remote site, download it to a local drive on your server, and then produce the thumbnail


FtB
spikehalliwellAuthor Commented:
is that action possible in asp.net?
fritz_the_blankCommented:
Sorry not to have responded...

There should be a way to do that. For example, in ASP, I can do this:

Function GetHTML(strURL)
      Dim objXMLHTTP, strReturn
      Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
      objXMLHTTP.Open "GET", strURL, False"
      objXMLHTTP.Send
      strReturn = objXMLHTTP.responseText
      Set objXMLHTTP = Nothing
      GetHTML = strReturn
End Function

to grab the contents of a page. So I am guessing that ASP.Net might have that sort of functionality, but I don't know how to do it...

FtB

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
spikehalliwellAuthor Commented:
Thank you very much i'll take this issue as resolved - fritz_the_blank thank you again

SP!KE
fritz_the_blankCommented:
I am sorry, but I don't think that I helped very much here...

FtB
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.