this is how I choose (thanks to this question / answer ImageAreaSelect: pre-select the maximum possible sketch, observing aspectRatio )
var thwidth = $('#thumbnail').width(); var thheight = $('#thumbnail').height(); var aspectRatio = <?php echo $thumb_height/$thumb_width;?>; var selWidth = 640; var photo = $('#thumbnail'), photoWidth = parseInt($('#thumbnail').width()), maxWidth = Math.min(selWidth, photoWidth), maxHeight = maxWidth * aspectRatio, yTop = parseInt(photo.height()) / 2 - maxHeight / 2; var thumbsel = $('#thumbnail').imgAreaSelect({ x1: photoWidth / 2 - maxWidth / 2, y1: yTop, x2: (photoWidth / 2 - maxWidth / 2) + maxWidth, y2: yTop + maxHeight, aspectRatio: '1:<?php echo $thumb_height/$thumb_width;?>', onSelectStart: function(){ $('#filters li').first().find('a').click(); }, onSelectChange: preview, onInit: preview, handles: true, resizable:true, show:true });
But the preview method doesn't seem to load in Init. The user needs to reselect, resize, or at least drag the current selection so that it is viewed:
Preview Method (taken from your site)
function preview(img, selection) { $('#filters li').first().find('a').click(); var scaleX = <?php echo $thumb_width;?> / selection.width; var scaleY = <?php echo $thumb_height;?> / selection.height; $('#uploaded_file').css({ width: Math.round(scaleX * <?php echo $current_large_image_width;?>) + 'px', height: Math.round(scaleY * <?php echo $current_large_image_height;?>) + 'px', marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' }); $('#x1').val(selection.x1); $('#y1').val(selection.y1); $('#x2').val(selection.x2); $('#y2').val(selection.y2); $('#w').val(selection.width); $('#h').val(selection.height); }
I tried using the init function:
$('.imgareaselect-selection').mouseup();
But with great success ...
But I believe that the solution would be to re-drag and drop or something like that?
-Edit -
If you look at this screenshot:

you can see that the pre-selection was successful, but the preface is not ..
If I just clicked / moved the selection: then it looked

So the question will be this:
How can I reproduce the selection? vĂa plugins or DOM events
Jsfiddle
-EDIT2 -
Well, I chose this solution, why not start the preview function after the plugin is initialized?
var my_options = { x1 : photoWidth / 2 - maxWidth / 2, y1 : yTop, width : (photoWidth / 2 - maxWidth / 2) + maxWidth - photoWidth / 2 - maxWidth / 2, height : yTop + maxHeight - yTop } preview('',my_options);