SunQuest
 
           Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #16  
Old September 4th, 2007, 04:55 PM
airpan airpan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Pennsylvania
Posts: 40 airpan User rank is Corporal (100 - 500 Reputation Level)airpan User rank is Corporal (100 - 500 Reputation Level)airpan User rank is Corporal (100 - 500 Reputation Level)airpan User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 17 m 55 sec
Reputation Power: 2
Quote:
Originally Posted by Shadow Wizard
Attached is aspx file that can resize given image on the fly to the desired width and/or height.

To use this in classic ASP code, use XMLHTTP component in
order to "communicate" with the aspx file. simply pass the
URL as demonstrated above:
Code:
<%
Dim strImageName, strThumbName, objXML
strImageName = "mypicture.jpg"
strThumbName = "mypicture_thumb.jpg"
Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", "http://localhost/ImageResizer.aspx?image=" & Server.MapPath(strImageName) & "&thumb=" & Server.MapPath(strThumbName) & "&width=500&height=-1", True
objXML.Send
Set objXML=Nothing
Response.Write("original: <img src=""" & strImageName & """ /><br />")
Response.Write("thumbnail: <img src=""" & strThumbName & """ /><br />")
%>


Shadow Wizard,
I am a noob at this... so I just want to be sure that I am understanding how to accomplish this. I have your original code ShadowUploader.asp. However, I was wondering how the ImageResizer.aspx correlates to the ShadowUploader.asp. In other words, is the ImageResizer working in conjunction with the ShadowUploader? If so, I am assuming that I will need to use a file include on either my upload form or the actual ShadowUploader page?

Second, I am not clear on your above instructions of the ImageResizer. When you say to the pass the URL, am I to just type in the URL to the browser window? I am using IIS on my local computer for testing purposes. Thank you in advance... I have never created a photo upload before so I am kind of in the dark.

Reply With Quote
  #17  
Old September 7th, 2007, 12:57 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,608 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 12 h 53 m 47 sec
Reputation Power: 1400
right now, the Image Resize and Upload are not related in any way.
I can add some built in integration, just need some time for this.

you need to use XMLHTTP component in order to call and use the
Resizer from within classic ASP code, the first post in the thread
contains full source code needed for that. (last block of code)

Reply With Quote
  #18  
Old September 11th, 2007, 08:17 AM
airpan airpan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Pennsylvania
Posts: 40 airpan User rank is Corporal (100 - 500 Reputation Level)airpan User rank is Corporal (100 - 500 Reputation Level)airpan User rank is Corporal (100 - 500 Reputation Level)airpan User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 17 m 55 sec
Reputation Power: 2
Thanks Shadow Wizard. I will now dip my pinky toe into the dark and foreign waters of photo upload. )

Reply With Quote
  #19  
Old November 9th, 2007, 12:32 AM
saturnx saturnx is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 10 saturnx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 28 sec
Reputation Power: 0
Hi Shadow Wizard,

First of all thank you for sharing the script with all of us.

I am actually putting together a image cropper feature and there it will allow a user to scale the image as well as select an area to crop. Base on your script is it possible to pass the additional information like the x & y coords and the scaled factor to your script to process and create thumbnail accordingly? If yes, how do i go about doing so?

Thanks...

Reply With Quote
  #20  
Old November 11th, 2007, 02:31 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,608 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 12 h 53 m 47 sec
Reputation Power: 1400
yes you can pass additional values over the querystring, for example:
Code:
objXML.Open "GET", "http://localhost/ImageResizer.aspx?image=" & Server.MapPath(strImageName) & "&thumb=" & Server.MapPath(strThumbName) & "&x1=50&y1=100&x2=150&y2=200", True

this will pass two points: (x1,y1) and (x2,y2) of area to be cropped.
however, the cropping itself will need whole different code than what I have.

Reply With Quote
  #21  
Old November 12th, 2007, 08:38 PM
saturnx saturnx is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 10 saturnx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 28 sec
Reputation Power: 0
Would it be hard to modify the script to include cropping and is it easy? Or maybe you could point me to the right direction where i can get more info on this and i try it out myself to see if it works. I'm up for the challenge

Thanks also for the prompt reply.

Reply With Quote
  #22  
Old November 13th, 2007, 03:59 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,608 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 12 h 53 m 47 sec
Reputation Power: 1400
I found this, which look pretty nice:
http://snippets.dzone.com/posts/show/1484

Reply With Quote
  #23  
Old November 13th, 2007, 04:44 AM
saturnx saturnx is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 10 saturnx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 28 sec
Reputation Power: 0
Thank you for the URL Shadow. Will give it a try in the morning. Will post my results here if it works. Thanks again.

Reply With Quote
  #24  
Old November 13th, 2007, 04:58 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,608 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 12 h 53 m 47 sec
Reputation Power: 1400
if it works you can post here the whole modified code for the benefit of others.

Reply With Quote
  #25  
Old November 13th, 2007, 07:43 AM
mirza_yasir4 mirza_yasir4 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 68 mirza_yasir4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 45 m 53 sec
Reputation Power: 2
very nice code

thanks

Reply With Quote
  #26  
Old April 4th, 2008, 04:41 PM
dsflores dsflores is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 dsflores User rank is Sergeant (500 - 2000 Reputation Level)dsflores User rank is Sergeant (500 - 2000 Reputation Level)dsflores User rank is Sergeant (500 - 2000 Reputation Level)dsflores User rank is Sergeant (500 - 2000 Reputation Level)dsflores User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 26 m
Reputation Power: 0
Realtime resize without saving image on the server?

ImageResizer.aspx is one cool script!

Now for the impossible feature: Would it be possible for ImageResizer.aspx to return the resized image?

To be used like this:
<img src="ImageResizer.aspx?image=test.jpg">

To show the small image realtime, without saving it on the server.

Found a way!!!! (Still needs a bit of work..)
Edited ImageResizer.aspx, commented lines listed below and added a few lines.
.
.
.
//string strThumbnailPath=ToStringDef
.
.
.
//if (strThumbnailPath.Length == 0)
//{
// Response.Write("missing thumbnail path");
// Response.End();
//}
.
.
.
//wrapper.Save(strThumbnailPath);
Response.Buffer = true; //New
Response.ContentType = "image/jpeg"; //New
wrapper.Bitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg); //New
bitmap.Dispose();
//Response.Write("OK");
.
.
.

ASP call is like this:
<img src="ImageResizer.aspx?image=C:\WebSites\ImageTesting\t est2.jpg&width=200&height=-1" />
Comments on this post
Shadow Wizard agrees!

Reply With Quote
  #27  
Old April 6th, 2008, 02:18 AM
saturnx saturnx is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 10 saturnx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 28 sec
Reputation Power: 0
My apologies my fellow coders...

i realised that i never updated this thread. I never did get to fixing the code as we took a short cut to solve the image cropping and resize problem. As our server supported php running parallel with asp we found a third party code running in php that uses GD to manipulate the image. What we did was a popup loading the php file to manipulate the image, save it to our target location then got php to talk to asp (php talk to asp?? oh yes it is possiblle.) informing that it was done and to update our database. I know i have sidelined from asp but as a programmer we have to resourceful to get the problem solved. lolz..

Reply With Quote
  #28  
Old April 7th, 2008, 06:15 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,608 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325618 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 12 h 53 m 47 sec
Reputation Power: 1400
Quote:
Originally Posted by dsflores
ImageResizer.aspx is one cool script!

Now for the impossible feature: Would it be possible for ImageResizer.aspx to return the resized image?
...
ASP call is like this:
<img src="ImageResizer.aspx?image=C:\WebSites\ImageTesting\t est2.jpg&width=200&height=-1" />

thanks for sharing this - cool trick, cheers for finding it!

@saturnx - no worry, that's fine. thanks for letting us know.

Reply With Quote