Skip to content

Instantly share code, notes, and snippets.

View mafia99's full-sized avatar

Muhammad Ali Fayyaz mafia99

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mafia99 on github.
  • I am malifayyaz (https://keybase.io/malifayyaz) on keybase.
  • I have a public key ASAV6Tdc9SjH3EarL_-Uig-H9Y9I1gHBdvfLeIAZa0D62Qo

To claim this, I am signing this object:

@mafia99
mafia99 / ImageOriantationFix.txt
Last active March 9, 2017 23:04
Fixing Image Oriantation
$exif = exif_read_data($imagePath);
$img = 'pathTo/imagename';//This will be the path of the Corrected image
//fix the Orientation if EXIF data exist
if (!empty($exif['Orientation'])) {
$imageResource = imagecreatefromjpeg($imagePath);
switch ($exif['Orientation']) {
case 8:
$createdImage = imagerotate($imageResource, 90, 0);
break;
case 3: