Jcrop Large Image True Size

7.3k Views Asked by At

I'm having a problem using jCrop...

If I upload a image, for example, 1024x768, he will get most of my browser. So what I did in order to turn around?

<div style="width:300px;height:300px;(Just examples!)">
<img> bla bla
</div>

And now it's working, but now, I need the real size of the image. basically, I have a div that contains the image that I want to crop, but I want the true size of them..

Some things I've already attempted:

Tried to make a div with overflow:scroll, the problem was, while I was cropping, I wanted, while cropping, when I reach the limits of the div, he scrolls while I was going on..

Some help will be useful. (Sorry for bad english)

1

There are 1 best solutions below

2
On BEST ANSWER

Rather than setting the dimensions of your image in CSS, jcrop has boxWidth and boxHeight parameters for this purpose.

Using these parameters, jcrop will resize the image to fit in the specified box size, but it will still output values relative to the true size.

You can set them like this:

$(function() {
    $('#cropbox').Jcrop({ boxWidth: 300, boxHeight: 300 });
});

See here for more information: http://deepliquid.com/content/Jcrop_Sizing_Issues.html