jcrop

Input file show live selected image in JCrop

℡╲_俬逩灬. 提交于 2019-12-06 12:14:20
I am using JCrop to resize and crop images. I wanted to add a feature so the user can: -Select a image file -Use jcrop to edit -Upload without changing the page I can do all these separately, but I get bugs when I mix these. $('#target').attr('src', e.target.result); $('#target2').attr('src', e.target.result); The problem right now is, when I change the src location of id "target" main image, it doesn't show my new image. But when I do it on the id "target2" preview image it does show my new image and I can work on it.(But doesn't crop the new image when i press crop) <script src="jquery.min

JCrop resizing the image not cropping - Javascript

こ雲淡風輕ζ 提交于 2019-12-06 10:14:48
I am trying to use JCrop to crop an image. However the results are frustratingly wrong and I am not sure why. I have an image uploader that when someone selects in image a javascript changes the source of an image already on the page to match the newly upload image. I then have this code: $('#myForm').ajaxForm({ dataType: 'json', success: function (result) { $("#image-editor-preview img") .attr("src", "/Profiles/AvatarWorker/" + _id + "?random=" + Math.random()) .Jcrop({ aspectRatio: 1, setSelect: [100, 100, 50, 50], minSize: [160, 160], maxSize: [160, 160], onChange: setCoords, onSelect:

jQuery how to add to Jcrop zoom feature

六月ゝ 毕业季﹏ 提交于 2019-12-06 07:13:49
问题 JCrop it is a really great plugin but unfortunately lack of Zoom-In Zoom-Out feature. I would like to know if someone have ever tried to add a Zoom-In Zoom-Out feature in jCrop. Please post an example of code. Thanks 回答1: This is a very quick and dirty way to do it... In the demo file provided with Jcrop called "crop.php" you'll find this function: $(function(){ $('#cropbox').Jcrop({ aspectRatio: 1, onSelect: updateCoords }); }); Delete the entire function above and replace it with this: $

GWT client side cropping

末鹿安然 提交于 2019-12-06 05:49:55
I'm stuck on integrating gwt with JCrop or imgareaselect javascript libraries I have an image, which url is changing each time the client change the file choosen from its filesystem (using an upload widget). I want the user select the area in its image, this way i will be able to have images with aspect ratio respected respect to the client wishes. Problem is i can't succed in making imgareaselect or jcrop called on load event, each time i have null, if i try jquery ("imagepreview") jquery is unknow at execution time, if i try some $("#imagepreview") i get a $ is undefined... PLEASE any help..

Cannot drag selection in Jcrop, what could break it?

点点圈 提交于 2019-12-06 03:47:23
问题 I'm at a loss. I'm using JQuery 1.4.2 and JCrop 0.98. Everything else works fine, but I cannot move a selection once created. When I mouse over the selection and click, nothing happens. I have the JQuery library, the JCrop library and the JCrop css file all included. It's a pretty clean page without much else on it. I don't know if I'm accidentally overriding something in my own javascript and css in such a way that it breaks JCrop, there's quite a bit of both. But Firebugs isn't turning

Disable mouse click outside cropped region

青春壹個敷衍的年華 提交于 2019-12-05 22:54:31
I'm trying to use jquery jcrop to crop images. this code starts the plugin adding some selected area to the image with aspcet ratio. $('#cropbox').Jcrop( { setSelect: [ 100, 100, 50, 50 ], aspectRatio: 16 / 9 }); But if user clicks mouse on image somewhere else, the selection disappears. So what I want is to disable mouse clicks in this plugin so selected area will remain over the image. SOLUTION I've received email on my request to the creators of jcrop and that solved the problem Here is the solution First there must be some setSelect , so some area is always selected from the beginning. And

ASP.NET图片上传和截取

跟風遠走 提交于 2019-12-05 19:48:52
一、介绍:图片的上传直接使用ajax就可以了,截取图片的话使用到Jcrop插件。   图片上传资料:https://www.jb51.net/article/87654.htm   截取图片插件:http://code.ciaoca.com/jquery/jcrop/ 前端 添加引用 1 <script src="../js/jquery.min.js"></script> 2 <link href="../Css/jquery.Jcrop.min.css" rel="stylesheet" /> 3 <script src="../js/jquery.Jcrop.min.js"></script> HTML代码 1   <input type="file" name="photo" id="photo" value="" placeholder="免冠照片"> 2 <input type="button" onclick="postData();" value="下一步" name="" style="width: 100px; height: 30px;"> 3 <img id="showPhoto" /> JavaScript代码 1 <script type="text/javascript"> 2 //文件上传方法 3 function postData() { 4

Using jCrop with cloudinary through rails 4 to crop before creating image

99封情书 提交于 2019-12-05 19:21:01
I've been at this for some time now. I"m using cloudinary to upload photos and am trying to implement a cropping feature using jcrop on a photo create action. After I implemented cloudinary I followed railscasts #182 on Jcrop. I think I'm having problems getting the new cropped parameters (x,y,w,h) back to the uploader before the image is saved. Update: I'm not even getting the values put into the f.text_fields. When I move the cropper around, there should be new values right? Here's a pic of what it looks like with empty fields: Also when I submit the photo, now I'm getting conflicting

jCrop - update preview onload?

你。 提交于 2019-12-05 16:38:29
I am using the jCrop preview demo to do my own thing. However I have run into a problem. If I create a default selection when the image loads using setSelect: then I have the selection mapped out on the big image but it doesn't appear on the preview. I cannot find an api handler to call the updatePreview function when jCrop loads. Does anyone know how to call this function when jCrop loads? jQuery(function($){ // Create variables (in this scope) to hold the API and image size var jcrop_api, boundx, boundy; $('#target').Jcrop({ onChange: updatePreview, onSelect: updatePreview, setSelect: [ 0, 0

Cropping image drawn into canvas with JCrop

不想你离开。 提交于 2019-12-04 16:00:34
I'm new to HTML5 and trying to crop an image with JCrop. There is no problem if I want to crop it directly but when it is drawn into a canvas JCrop does not work. I think the reason maybe that I'm creating an image variable to be able to draw it into viewport canvas and setting it's Id dynamically. So Jquery cannot access that dynamically created image. But even so I don't know what to do. Here is my full HTML code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv=