Photo Upload Rotation Issues and EXIF Education - NCRS Discussion Boards

Photo Upload Rotation Issues and EXIF Education

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Richard M.
    Super Moderator
    • August 31, 1988
    • 11302

    Photo Upload Rotation Issues and EXIF Education

    Beginning discussion about the Subject - To be continued as I learn more. I know this is a lot to read but after a while it will make sense.

    I think I figured it out. Most importantly, see the Notes below marked "MORE INFORMATION".

    ===

    I've been spending some time in the Test Forum experimenting to try to understand the common issue of why many of us are having problems uploading images from smartphones, the biggest problem is they get rotated after being uploaded here.

    Research appears to be showing the same issue with other vBulletin based Public Forums. A common occurrence is when a photo appears oriented correctly on the phone, or on the PC/iPad, etc, once it's uploaded here it has a mind of its own. It goes sideways, or sometimes upside down.

    Reference this vBulletin Forum post from 2014.... Here


    The first thing to remember is ALWAYS turn OFF the feature "Autorotate" on the smartphone. As some may have experienced, even with that feature OFF, it still rotates the photo upon upload. I have been dealing with this anomaly continuously with my Android version phone. It's a intermittent issue, in other words, it happens on some files, but not all. They all look properly oriented on the PC before upload.

    In my research, it has been discovered that if the photo exceeds our maximum Width and Height limits, vBulletin will rotate the photos to maintain conformity to the limits and aspect ratio(W:H, where W > H). Our image limit sizes are, in pixels, 800W x 600H. This is a aspect ratio of 4:3, meaning the picture is expected to be wider than it is higher.

    Reference info Here
    A quote from above reference reads....
    "When your photos exceed the max horizontal width or vertical height, vBulletin will rotate them to fit those dimensions."

    Example 1:

    This image should show the blue paper towel at the top. It is viewed that way on my Android phone, as well as the PC where I uploaded from. The file is 780W x 1040H.(AR 3:4)
    After upload here, it has been rotated 90* CCW.
    Resized_NG.jpg
    When viewing file attributes after upload, vBulletin reduced its size to 800W x 600H.
    But it rotated it to be within those limits and aspect ratio.

    Within the image data exits information about the photo called EXIF - (Exchangeable Image File Format)

    VBulletin does not use EXIF data according to vBulletin Support.

    I use the Irfanview photo viewer/editor for capturing EXIF data.... https://www.irfanview.com

    Here is the EXIF data for the above file:

    Filename - Resized_NG.jpg
    Orientation - Right top (See Note A below)
    Model - VS835
    ImageWidth - 272629760
    Exif-IFD-Offset - 139
    ImageLength - 204472320
    DateTime - 2022:12:19 16:38:46
    Make - LG Electronics
    FocalLength - 3.50 mm
    ExposureTime - 1/25.1 seconds
    LightSource - Auto
    FNumber - 2.20
    White Balance - Auto
    Flash - Not fired
    ISOSpeedRatings - 50


    Example 2:

    Here is another file, but it uploads with proper orientation.

    This image should show the bench vice at the top. It is viewed that way on my Android phone, as well as the PC where I uploaded from. It is 1040W x 780 H (AR 4:3)
    It uploads properly.
    Resized_OK.jpg
    When viewing file attributes after upload, vBulletin reduced its size to 800W x 600H.

    EXIF data:

    Filename - Resized_OK.jpg
    Orientation - Top left (See Note B below)
    Model - VS835
    ImageWidth - 272629760
    Exif-IFD-Offset - 139
    ImageLength - 204472320
    DateTime - 2022:12:19 16:38:38
    Make - LG Electronics
    FocalLength - 3.50 mm
    ExposureTime - 1/25.1 seconds
    LightSource - Auto
    FNumber - 2.20
    White Balance - Auto
    Flash - Not fired
    ISOSpeedRatings - 150

    Summary: (This may change)

    Before uploads here, verify the photo has a width greater than its height, ideally 800W x 600H or less.

    If the image Height is greater than its Width and exceeds the limits, chances are it will rotate when displayed here. But there are other reasons as explained later.

    ------

    EXIF Education

    From: http://sylvana.net/jpegcrop/exif_orientation.html

    The Orientation of the camera relative to the scene, when the image was captured. The relation of the '0th row' and '0th column' to visual position is shown as below.

    The Exif Orientation flag can have nine different values from 1 to 9. The image below shows eight of them:
    20190731232000.png

    Value 0th Row 0th Column Description
    1 top left side normal
    2 top right side flip horizontal
    3 bottom right side rotate 180*
    4 bottom left side flip vertical
    5 left side top transpose
    6 right side top rotate 90*
    7 right side bottom transverse
    8 left side bottom rotate 270*















    MORE INFORMATION

    Using this information relative to the above 2 Images I uploaded, it now is clear why the first example rotated but the second example did not rotate.

    Note A Example 1

    EXIF Orientation - Right top (value 6)
    The photo in Example 1 rotated 90* CCW when uploaded. Using the above Value of 6 "right side top", in the above character image simulation of the letter "F", you can see it is rotated 90* CCW. vBulletin displayed what it got, a sideways photo. I explain this below.

    In my research I discovered new information as to why my PC rotate workaround "works". I never figured it out until now.

    Further research explains that on a PC, after Windows 7, and likely MAC/iPads after a similar timeframe, the photo viewers use EXIF data and adjust the view to display the proper orientation for normal viewing. The EXIF Orientation of the photo in Example 1 defines that it "should" be sideways(EXIF - Orientation value 6), but the PC software corrects it to display it normally. So when I thought it looked properly oriented on the PC, it really was only "displaying" it properly. It was hiding the "truth".

    Because vBulletin does NOT use EXIF data for orientation, it did not understand the proper display for normal viewing and uploaded what it saw without modification, a sideways 90* CCW rotated photo.

    Now, when the user on the PC/iPad rotates the file, saves, then rotates back, then saves, it modifies the EXIF Orientation to Top left(normal view). In other words, it "fixes" it.

    Here is Example 1 photo again after I used the PC viewer to Rotate 90* CW, then Save, then Rotate back to normal, then Save. The photo was actually already rotated 90* when it was taken on my Android phone, but the PC hid that attribute by autocorrection. This is why it seemed odd that viewing on the PC was fine, but upload here was not.

    As seen below, it did NOT rotate 90* CCW. The PC modified the EXIF Orientation before upload. Before the PC rotate/save/rotate-back/save, it was EXIF Orientation "Right top"(6), 90*CCW. After it saved it on the PC, it was changed to EXIF Orientation "Top left"(1), normal. This is obviously a artifact of the PC viewer software, and as you can see below it's software stamp is attached to the EXIF data in the "Software" column. This line did not exist prior to the viewer modification.
    Resized_NG - Copy_PC_Rotate_Save.jpg

    EXIF data:

    Filename - Resized_NG - Copy_PC_Rotate_Save.jpg
    ImageWidth - 272629760
    ImageLength - 204472320
    Make - LG Electronics
    Model - VS835
    Orientation - Top left <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< NOTE Changed from original value Right Top
    Software - Microsoft Windows Photo Viewer 6.3.9600.16384 <<<<<<<<< NOTE Added after PC workaround
    DateTime - 2022:12:28 16:25:41
    Exif-IFD-Offset - 2270
    ExposureTime - 1/25.1 seconds
    FNumber - 2.20
    ISOSpeedRatings - 50
    LightSource - Auto
    Flash - Not fired
    FocalLength - 3.50 mm
    White Balance - Auto


    Note B Example 2

    EXIF Orientation - Top left (value 1)
    The photo in Example 2 did not rotate when uploaded. Again, using the the above Value of 1 "top left", in the above simulation of the letter "F", you can see it is displayed normally with no rotation. Apparently vBulletin simply displayed it based on its W > H criteria, reduced the pixel counts within limits and the result is displayed normally.


    More EXIF info:
    The other day I came across a strange bug during work. My colleagues gave me some photographs taken with a smartphone. On their machines (Windows 7), all the photos were shown correctly in landscape mode. However, when I checked those photos, I found that some of those photos were shown in portrait mode (rotated 90 or 270 degrees) or upside-down (rotated 180 degrees). I was curious what happened and learned about Exif and all its related stuff.



    Overall Summary:

    Since vBulletin does not autocorrect EXIF Orientation, we will continue to have issues with photos rotating from smartphones. Users are NOT going to go into each photo and try to modify settings to get them oriented.

    Rich
Working...

Debug Information

Searching...Please wait.
An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

Please push the back button and reload the previous window.'
An unexpected error was returned: 'Your submission could not be processed because the token has expired.

Please push the back button and reload the previous window.'
An internal error has occurred and the module cannot be displayed.
There are no results that meet this criteria.
Search Result for "|||"