Hello!
i'm sorry i can't help for real... just trying. You should have
something like this:
Event.observe(
window,
'load',
function() {
var obj = new Cropper.Img(
'testImage',
<?
$gis = getimagesize($image);
$width = $gis[0];
$height = $gis[1];
if($width>$height){?>
{
ratioDim: { x: <?=$ratioWidth?>, y: <?=$ratioHeight?> },
minWidth: <?=$ratioWidth?>,
minHeight: <?=$ratioHeight?>,
displayOnInit: true,
onEndCrop: onEndCrop
}
<?}else{?>
{
ratioDim: { x: <?=$ratioHeight?>, y: <?=$ratioWidth?> },
minWidth: <?=$ratioHeight?>,
minHeight: <?=$ratioWidth?>,
displayOnInit: true,
onEndCrop: onEndCrop
}
<?}?>
)
}
);
generally speaking: you get the uploaded image sizes then set the
cropper ratio depending on width and height of the uploaded images...
could you explain me how did you manage to allow users to rotate the
cropper? i'm working on that, but can't get it... thanks!