Skip to content

Instantly share code, notes, and snippets.

View asilverstein's full-sized avatar

Alex T. Silverstein asilverstein

View GitHub Profile
@asilverstein
asilverstein / upload.php
Created February 28, 2017 14:13 — forked from msurguy/upload.php
Automatic image rotation from mobile Recently I had a use case when I needed to automatically rotate uploaded pictures according to the sensor data embedded in the image (think iPhone, iPad, Android phones, DSLR cameras, etc) I ended up using PHP Imageworkshop (http://phpimageworkshop.com/documentation.html) for all my image processing needs so …
//retrieve the image
$image = Input::file('image');
// initialize imageworkshop layer
$layer = PHPImageWorkshop\ImageWorkshop::initFromPath($image['tmp_name']);
if (File::is('jpg', $image['tmp_name']))
{
$exif = exif_read_data($image['tmp_name']);