Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redimensionnement proportionnel #15

Closed
blackheaven opened this issue Apr 15, 2014 · 2 comments
Closed

Redimensionnement proportionnel #15

blackheaven opened this issue Apr 15, 2014 · 2 comments
Labels
good first issue Good for newcomers

Comments

@blackheaven
Copy link

@blackheaven
Copy link
Author

Un truc du style :

$targetWidth = 90;
$targetHeight = 120;
$ratioWidth = $width/$targetWidth;
$ratioHeight = $height/$targetHeight;
$ratio = max($ratioWidth, $ratioHeight);
imagecopyresampled($img, $oldImg, 0, 0, 0, 0, ceil($width/$ratio), ceil($height/ratio), $width, $height);

@thierrymarianne thierrymarianne added the good first issue Good for newcomers label Mar 23, 2015
@xavierleune
Copy link
Member

Ca a été fixé pour le php tour de cette année :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants