[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2495
  • Last Modified:

Upload and Crop Images with jQuery, JCrop and ASP

Hello, can you help me with a solution for using pure ASP and JCrop
to upload and crop images?
0
daiamon
Asked:
daiamon
  • 5
  • 4
  • 3
  • +1
1 Solution
 
HainKurtSr. System AnalystCommented:
thats it? no code no error, you just want a solution?
0
 
daiamonAuthor Commented:
I've searched in every way but did not find a proper script for ASP. All are integrated with PHP and I have no knowledge to convert.
0
 
HainKurtSr. System AnalystCommented:
have a look at this

http://webcropimage.codeplex.com/
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
HainKurtSr. System AnalystCommented:
0
 
daiamonAuthor Commented:
I need something using classic ASP.
0
 
HainKurtSr. System AnalystCommented:
check this

http://911-need-code-help.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html

it is using this component, a bit pricy

http://www.aspjpeg.com/

are you looking for something free?

0
 
daiamonAuthor Commented:
I'd like something more interactive as an example:

http://deepliquid.com/projects/Jcrop/demos.php

But I have no knowledge in itself sufficient to convert the code for Classic ASP and found nothing like it in Google.
0
 
Scott Fell, EE MVEDeveloperCommented:
There is aspjpeg and aspupload.  I disagree with HainKurt on being pricy.  They are only $200. I say that is dirt cheap compared to what your time is worth to recreate it.  I use both of those.    I also use http://www.imagemagick.org.   It is free but there is a longer learning curve over aspjpeg which is a little more straight forward.  Imagemagick gives you a lot more options for manipulating your images though.  

You are asking about a 3 step process.

1) File upload
2) image resize/optimize (image magick or aspjepg)
3) Image crop via jcrop

By the way, if you are on shared hosting, you should check to see if any of those are already installed on  your server.   Many times they are.  
0
 
daiamonAuthor Commented:
using ASPJEG I'm ready but I need something more interactive and could not find with jquery + ASP.
0
 
Scott Fell, EE MVEDeveloperCommented:
Check this out http://deepliquid.com/projects/Jcrop/demos/tutorial2.html 
You can see in the code below that it simply puts the parameters in the form fields.  The fields could just as well be hidden.   So with those coordinates you simply submit the form and send the info to aspjpeg
 
<!doctype html> 
<html> 
	<head> 
		<meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> 
		<title>Jcrop &raquo; Tutorials &raquo; Event Handler</title> 
		<script src="../js/jquery.min.js"></script> 
		<script src="../js/jquery.Jcrop.js"></script> 
		<link rel="stylesheet" href="../css/jquery.Jcrop.css" type="text/css" /> 
		<link rel="stylesheet" href="demo_files/demos.css" type="text/css" /> 
		<script type="text/javascript"> 
 
			jQuery(document).ready(function(){
 
				jQuery('#cropbox').Jcrop({
					onChange: showCoords,
					onSelect: showCoords
				});
 
			});
 
			// Simple event handler, called from onChange and onSelect
			// event handlers, as per the Jcrop invocation above
			function showCoords(c)
			{
				jQuery('#x1').val(c.x);
				jQuery('#y1').val(c.y);
				jQuery('#x2').val(c.x2);
				jQuery('#y2').val(c.y2);
				jQuery('#w').val(c.w);
				jQuery('#h').val(c.h);
			};
 
		</script> 
	</head> 
	<body> 
	<div id="outer"> 
	<div class="jcExample"> 
	<div class="article"> 
 
		<h1>Jcrop - Event Handlers</h1> 
 
		<!-- This is the image we're attaching Jcrop to --> 
		<img src="demo_files/flowers.jpg" id="cropbox" /> 
 
		<!-- This is the form that our event handler fills --> 
		<form onsubmit="return false;" class="coords"> 
			<label>X1 <input type="text" size="4" id="x1" name="x1" /></label> 
			<label>Y1 <input type="text" size="4" id="y1" name="y1" /></label> 
			<label>X2 <input type="text" size="4" id="x2" name="x2" /></label> 
			<label>Y2 <input type="text" size="4" id="y2" name="y2" /></label> 
			<label>W <input type="text" size="4" id="w" name="w" /></label> 
			<label>H <input type="text" size="4" id="h" name="h" /></label> 
		</form> 
 
		<p> 
			<b>An example with a basic event handler.</b> Here we've tied
			several form values together with a simple event handler invocation.
			The result is that the form values are updated in real-time as
			the selection is changed, thanks to Jcrop's <em>onChange</em> event handler.
		</p> 
 
		<p> 
			That's how easily Jcrop can be integrated into a traditional web form!
		</p> 
 
		<div id="dl_links"> 
			<a href="http://deepliquid.com/content/Jcrop.html">Jcrop Home</a> |
			<a href="http://deepliquid.com/content/Jcrop_Manual.html">Manual (Docs)</a> 
		</div> 
 
 
	</div> 
	</div> 
	</div> 
	</body> 
 
</html>

Open in new window


Send the coordinates form the form fields to aspjpeg and use the crop function.
http://www.aspjpeg.com/object_aspjpeg.html#Crop

This is harder to think about then to actually do.  All jcrop is doing here is giving your the coordinate.  Aspjpeg is doing the dirty work.
0
 
daiamonAuthor Commented:
0
 
Scott Fell, EE MVEDeveloperCommented:
It shows a 404 error meaning that page is not there.  Double check the page exists live.
0
 
ee_autoCommented:
Question PAQ'd and stored in the solution database.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now