diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Crop/crop02.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Crop/crop02.html.twig index 434062b0..baa550f0 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Crop/crop02.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/Crop/crop02.html.twig @@ -49,5 +49,24 @@ $(window).load(function () { $('#largeimg').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview }); + + + var selection = new Object(); + if($('#largeimg').height()<$('#largeimg').width()) { + selection.width = $('#largeimg').height(); + selection.height = $('#largeimg').height(); + } + else { + selection.width = $('#largeimg').width(); + selection.height = $('#largeimg').width(); + } + + selection.x1=0; + selection.x2=0; + selection.y1=0; + selection.y2=0; + + preview($('#largeimg'),selection); + }); {% endblock %}