Skip to content

Instantly share code, notes, and snippets.

View thomasRag's full-sized avatar

Thomas Ragot thomasRag

  • Anagraph
  • Montreal, QC, Canada
View GitHub Profile
@thomasRag
thomasRag / keybase.md
Created January 11, 2019 20:51
keybase proof

Keybase proof

I hereby claim:

  • I am thomasrag on github.
  • I am thomasrag (https://keybase.io/thomasrag) on keybase.
  • I have a public key ASCRwo_gWvY16Uhm5__nVgjLnM6ay6GZ61ddNp6RzYs3iQo

To claim this, I am signing this object:

@jasdeepkhalsa
jasdeepkhalsa / imageCropAdvanced.php
Created December 19, 2012 20:02 — 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
<?php
$image = imagecreatefromjpeg($_GET['src']);
$filename = 'images/cropped_whatever.jpg';
$thumb_width = 200;
$thumb_height = 150;
$width = imagesx($image);
$height = imagesy($image);