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?
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.
0
 
spikehalliwellAuthor Commented:
HUGE files not thumbnailed would cause a lot of bandwidth and slow user access to my pages by a lot
0
 
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.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
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
0
 
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
0
 
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..
0
 
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
0
 
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
0
 
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
0
 
fritz_the_blankCommented:
0
 
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??
0
 
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)
0
 
spikehalliwellAuthor Commented:
i don't want to go down this route until i'm sure it will work
0
 
fritz_the_blankCommented:
I see. So you are suggesting perhaps that I should test all of this and get back to you?

FtB
0
 
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
0
 
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
0
 
spikehalliwellAuthor Commented:
is that action possible in asp.net?
0
 
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
0

Experts Exchange Solution brought to you by ConnectWise

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
0
 
fritz_the_blankCommented:
I am sorry, but I don't think that I helped very much here...

FtB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.