Skip to content

Work whis resize image #1

Open
antonypp opened this Issue Nov 8, 2011 · 0 comments

1 participant

@antonypp
antonypp commented Nov 8, 2011

if i want crop image resaze by tag style="width=200px", and oridginal image width is 800. Crop not work, because I shod use ratio
example:
$size = getimagesize($image);
$ratio = $size[0]/$jcropper->targ_w;
$coords = $jcropper->getCoordsFromPost('imageId', $ratio);

public function getCoordsFromPost($attribute,$ratio=1)
{
$coords = array('x' => null, 'y' => null, 'h' => null, 'w' => null);
foreach ($coords as $key => $value) {
$coords[$key] = $ratio * $POST[$attribute . '' . $key];
}
return $coords;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.