This function does not honour EXIF orientation data. Pictures that are rotated using EXIF, will show up in the original orientation after being handled by imagecreatefromjpeg(). Below is a function to create an image from JPEG while honouring EXIF orientation data.<?php function imagecreatefromjpegexif($filename) { $img = imagecreatefromjpeg($filename); $exif = exif_read_data($filename); if ($img && $exif && isset($exif['Orientation'])) { $ort = $exif['Orientation']; if ($ort == 6 || $ort == 5) $img = imagerotate($img, 270, null); if ($ort == 3 || $ort == 4) $img = imagerotate($img, 180, null); if ($ort == 8 || $ort == 7) $img = imagerotate($img, 90, null); if ($ort == 5 || $ort == 4 || $ort == 7) imageflip($img, IMG_FLIP_HORIZONTAL); } return $img; }?>