Hello to all. Faced such an unusual situation. I have a photo upload function on my site. Today I noticed that the pictures from the retrika program are not displayed correctly when and after downloading. For a good example visit the website: http://plugins.krajee.com/file-avatar-upload-demo

And paste this photo into the box. http://celebizade.info/retrica.jpg

On the computer is normally displayed, and when inserted, it is automatically turned over. And it is pictures of retrika) How is this even possible? By the way, when uploading to the server via PCP is the same, in a flipped form)

    1 answer 1

    Here is a dump of image information that is inside your jpg:

    { 'width' => 2592, 'DateTime' => '2016:09:12 14:43:08', 'file_media_type' => 'image/jpeg', 'Tag-0x9208' => 0, 'file_ext' => 'jpg', 'Tag-0x9003' => '2016:09:12 14:43:08', 'color_type' => 'YCbCr', 'Model' => 'Lenovo P1a42', 'Tag-0x9286' => 'i. 100%', ..... 'BitsPerSample' => [ 8, 8, 8 ], 'SamplesPerPixel' => 3, 'Tag-0x9207' => 65535, 'height' => 1944, 'Orientation' => 'right_top', 'Software' => 'Retrica', 'Make' => 'Lenovo', 'resolution' => '1/1', 'JPEG_Type' => 'Baseline' }; 

    As you can see in each image contains a lot of additional information. Especially pay attention to the field 'Orientation' => 'right_top' . This field means that the camera was rotated 90 degrees when shooting. Image viewers usually take this fact into account and rotate the photo on the screen so as to compensate for the rotation of the device at the time of shooting. But programs that create smaller images for avatars often do not take this into account, and after the conversion, orientation tags also do not tolerate. The correct image conversion program should look at the orientation tags and rotate the image before making a smaller copy.