Images taken by iphone always show wrong orientation after upload to server. This is why. Fuck!
Reference:
- http://www.impulseadventure.com/photo/exif-orientation.html
- http://janochen.blogspot.tw/2008/09/exif-orientation.html
- PHP example:
http://richardsumilang.com/programming/php/graphics/working-with-apples-ios-image-orientation/ - https://www.thoughtco.com/why-is-my-picture-turned-sideways-1701398
- http://stackoverflow.com/questions/10600613/ios-image-orientation-has-strange-behavior
- PHP imagerotate():
http://php.net/manual/en/function.imagerotate.php - Get exif
http://stackoverflow.com/questions/7489742/php-read-exif-data-and-adjust-orientation
exif example: (taken by iphone 5)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
<pre>Array ( [FileName] => bc522572b9ed9f32d9f57dcb8fd120c5.jpg [FileDateTime] => 1492243697 [FileSize] => 2337483 [FileType] => 2 [MimeType] => image/jpeg [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS [COMPUTED] => Array ( [html] => width="3264" height="2448" [Height] => 2448 [Width] => 3264 [IsColor] => 1 [ByteOrderMotorola] => 1 [ApertureFNumber] => f/2.4 [Thumbnail.FileType] => 2 [Thumbnail.MimeType] => image/jpeg ) [Make] => Apple [Model] => iPhone 5 [Orientation] => 3 [XResolution] => 72/1 [YResolution] => 72/1 [ResolutionUnit] => 2 [Software] => 10.0.2 [DateTime] => 2017:04:15 15:47:57 [YCbCrPositioning] => 1 [Exif_IFD_Pointer] => 206 [GPS_IFD_Pointer] => 1016 [THUMBNAIL] => Array ( [Compression] => 6 [XResolution] => 72/1 [YResolution] => 72/1 [ResolutionUnit] => 2 [JPEGInterchangeFormat] => 1420 [JPEGInterchangeFormatLength] => 13367 ) [ExposureTime] => 1/20 [FNumber] => 12/5 [ExposureProgram] => 2 [ISOSpeedRatings] => 160 [ExifVersion] => 0221 [DateTimeOriginal] => 2017:04:15 15:47:57 [DateTimeDigitized] => 2017:04:15 15:47:57 [ComponentsConfiguration] => [ShutterSpeedValue] => 3799/879 [ApertureValue] => 4845/1918 [BrightnessValue] => 3615/1942 [ExposureBiasValue] => 0/1 [MeteringMode] => 5 [Flash] => 24 [FocalLength] => 103/25 [SubjectLocation] => Array ( [0] => 735 [1] => 1675 [2] => 231 [3] => 232 ) [MakerNote] => Apple iOSMM ht � � � bplist00�YtimescaleUvalueUepochUflags;��n�7�!'-2;= ?�;�����V����( [SubSecTimeOriginal] => 867 [SubSecTimeDigitized] => 867 [FlashPixVersion] => 0100 [ColorSpace] => 1 [ExifImageWidth] => 3264 [ExifImageLength] => 2448 [SensingMethod] => 2 [SceneType] => [ExposureMode] => 0 [WhiteBalance] => 0 [FocalLengthIn35mmFilm] => 33 [SceneCaptureType] => 0 [UndefinedTag:0xA432] => Array ( [0] => 103/25 [1] => 103/25 [2] => 12/5 [3] => 12/5 ) [UndefinedTag:0xA433] => Apple [UndefinedTag:0xA434] => iPhone 5 back camera 4.12mm f/2.4 [GPSLatitudeRef] => N [GPSLatitude] => Array ( [0] => 24/1 [1] => 57/1 [2] => 5964/100 ) [GPSLongitudeRef] => E [GPSLongitude] => Array ( [0] => 121/1 [1] => 32/1 [2] => 2447/100 ) [GPSAltitudeRef] => [GPSAltitude] => 47200/1367 [GPSTimeStamp] => Array ( [0] => 7/1 [1] => 47/1 [2] => 5537/100 ) [GPSSpeedRef] => K [GPSSpeed] => 0/1 [GPSImgDirectionRef] => T [GPSImgDirection] => 33149/140 [GPSDestBearingRef] => T [GPSDestBearing] => 33149/140 [GPSDateStamp] => 2017:04:15 [UndefinedTag:0x001F] => 29678/199 ) </pre> |