Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Marcos Pereira mvnp

🏠
Working from home
Block or report user

Report or block mvnp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jasdeepkhalsa
jasdeepkhalsa / imageCropAdvanced.php
Created Dec 19, 2012 — forked from anonymous/imageCropAdvanced.php
Using PHP and GD to crop an image proportionally according to its aspect ratio. From: http://stackoverflow.com/questions/1855996/crop-image-in-php
View imageCropAdvanced.php
<?php
$image = imagecreatefromjpeg($_GET['src']);
$filename = 'images/cropped_whatever.jpg';
$thumb_width = 200;
$thumb_height = 150;
$width = imagesx($image);
$height = imagesy($image);
You can’t perform that action at this time.