KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
We are coding a rather simple Javascript (jQuery) image cropper & resizer. Basically, for now, only features needed are indeed crop and resize . I have been checking a few jQuery plugins like JCrop etc. and it seems there's no plugins doing both things at same time. Lots of croppers OR resizer, but not the two features on a same "natural" image view at same time. By natural I mean that examples like this (bottom right) are not very nice visually for users : http://jsfiddle.net/opherv/74Jep/33/ Although I guess this would be a possible way to go to have the two features at same time. Though you can see this example only zooms too currently and it is qualified as using "ugly hacks" by the author himself to do so : function changeZoom(percent){ var minWidth=viewport.width(); var newWidth= (orgWidth-minWidth)*percent/100+minWidth; var newHeight= newWidth/orgRatio; var oldSize=[img.width(),img.height()]; img.css({ width: newWidth+"px", height: newHeight+"px" }); adjustDimensions(); //ugly hack :( if (img.offset().left+img.width()>dragcontainer.offset().left+dragcontainer.width()){ img.css({ left: dragcontainer.width()-img.width() +"px" }); } if (img.offset().top+img.height()>dragcontainer.offset().top+dragcontainer.height()){ img.css({ top: dragcontainer.height()-img.height() +"px" }); } } We are rather looking for the possibilty to use a cropper frame/zone (as we see the most often on the web) + a zoom/de-zoom option on the image (handles on the border of the image for example) Since we only need those two features we thought we would code this from scratch or almost as we don't want to add other javascript files/plugins which will be overkill anyway being packed with other features we will
Tags (comma-separated)
Save Edits
Cancel