ashu patel ashu patel - 11 months ago 103
HTML Question

Using jcrop jcrop-tracker's, the width and height are not a same as my image size

here is one of the small problem in using a Jcrop for crop image.
my image size is 870px * 340px but the Jcrop-tracker size is not as same as
my image size.

Below is my crop js:

window.cover_uploaded = (event) ->
if ($('.cover-preview').data('Jcrop'))
JcropAPI = $('.cover-preview').data('Jcrop')
JcropAPI.destroy()
$('.cover-preview').removeAttr('style')
JcropAPI.setSelect([0, 0, 498, 180])

$('.cover-preview').attr("src", event.fpfile.url + "/convert?quality=100")
$('p.hint').css("display", "block")
$('#event_cover_image_name').val(event.fpfile.filename)

$(".cover-preview").Jcrop
aspectRatio: 498/180,
boxWidth: 485,
setSelect: [150, 0, 150, 200],
onSelect: getCoordsE,
onChange: getCoordsE
->
get_ratio()


i hope any one can help me out :)

Answer Source

ashvin great question u need to only change Set Select value like below.

setSelect: [0, 0, 870, 340]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download