Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Unsure if bug or just me - pic displaying rotated --- Workaround found  (Read 6035 times)

0 Members and 1 Guest are viewing this topic.

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:June 01, 2022, 05:59:18 pm
  • <insert personal text here>
Pics are displaying rotated. Unsure if I did it or what.

http://newforum.arcadecontrols.com/index.php/topic,140466.200.html - build thread link with the wonky pics. Copied pics links from the pic-posting-thread. When you click them in my build thread they don't display correctly.

http://newforum.arcadecontrols.com/index.php/topic,159740.msg1680812.html#msg1680812 - pic-posting-thread link. They show rotated, which isn't how they show on my desktop file browser but then are oriented correctly when you click them. Doesn't seem to transfer when hyperlinked.

Am I doing something dumb on my end or is this a bug? If dumbness, how to fix? If bug, please to fix.
« Last Edit: March 17, 2019, 03:49:50 am by PL1 »

lilshawn

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6873
  • Last login:June 23, 2022, 09:32:13 pm
  • I break stuff...then fix it...sometimes
Re: Unsure if bug or just me - pic displaying rotated
« Reply #1 on: March 11, 2019, 10:12:50 am »
Traditionally, computers have always rotated images by moving the actual pixels in the image. Digital cameras didnít bother rotating images automatically. So, even if you used a camera and held it vertically to take a photo in portrait mode, that photo would be saved sideways, in landscape mode. You could then use an image editor program to rotate the image to appear in its correct portrait orientation. The image editor would move the pixels to rotate the image, modifying the actual image data.

This just worked, everywhere. The rotated image would appear the same in every programÖas long as you took the time to manually rotate them all.

Manufacturers wanted to solve this annoyance, so they added rotation sensors to modern digital cameras and smartphones. The sensor detects which way youíre holding the camera, in an effort to rotate the photos properly. If you take an image in portrait mode, the camera knows and can act accordingly so you donít have to rotate it yourself.

Unfortunately, thereís a small caveat. Digital camera hardware just couldnít handle saving the image directly in rotated form. So rather than performing the computationally intensive task of rotating the entire image's pixels, the camera would add a small piece of data to the file, noting which orientation the image should be in. It adds this information to the Exif data that all photos have (which includes the model of camera you took it with, the orientation, and possibly even the GPS location where the photo was taken).

In theory, then, you could open that photo with an application, it would look at the Exif tags, and then present the photo in the correct rotation to you. The image data is saved in its original, unrotated form, but the Exif tag allows applications to correct it.

Unfortunately, not every piece of software obeys this Exif tag. Some programs...especially older image programs...will just load the image and ignore the Exif Orientation tag, displaying the image in its original, unrotated state. Newer programs that obey Exif tags will show the image with its correct rotation, so an image may appear to have different rotations in different applications.

Rotating the image doesnít exactly help, either. Change it in an old application that doesnít understand the Orientation tag and the application will move the actual pixels around in the image, giving it a new rotation. Itíll look correct in older applications. Open that image in a new application that obeys the Orientation tag and the application will obey the Orientation tag and flip the already rotated image around, so itíll look wrong in those new applications.

ideally what you want to do is strip the Exif data, manually rotate the image, re-save it and post it in proper orientation for the most compatibility. But TL:DR it looks like the forum is ignoring Exif data for rotation.

Gilrock

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1030
  • Last login:June 23, 2022, 05:50:55 pm
Re: Unsure if bug or just me - pic displaying rotated
« Reply #2 on: March 11, 2019, 10:23:53 am »
Yeah I guess the forum software was written in the 80's like the games we like. :)  I ran into this when I first started posting here.  I immediately knew what was wrong just not used to running into that stone age problem.  The pain was I was linking images from my website and even though I fixed the images it seemed like they got cached or something so I ended up having to rename the images to get the post I was editing to show the correct orientation.  Such a pain.  So now I tend to just take all my photos as portrait even when landscape would have framed it better so I don't need to manipulate the result.

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:June 01, 2022, 05:59:18 pm
  • <insert personal text here>
Re: Unsure if bug or just me - pic displaying rotated
« Reply #3 on: March 11, 2019, 10:29:11 am »
Thanks for the detailed explanation! Iíll start rotating and saving in a photoshop I guess. That should fix it?

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6124
  • Last login:June 23, 2022, 06:35:03 am
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Re: Unsure if bug or just me - pic displaying rotated
« Reply #4 on: March 11, 2019, 10:35:19 am »
There actually is consideration for this in the forum software mods, but ...

To protect against malicious images (i.e. trojan horses inside image files, viruses/malware/etc) the software processes each image posted to check for such things.

The down side is in doing so, it strips EXIF information.  :-\

There is a mod to read EXIF information and to then present images in the right orientation, but it requires you turn off the security checking on the images so EXIF isn't stripped.

So we, and everyone else sane in the SMF world, errs on the side of security checking images and not properly reading EXIF info.

Ideally the code to strip security problems would retain or recreate the EXIF info, at least the orientation portion. But, no. :banghead:
--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

saint

  • turned to the Dark Side
  • Supreme Chancellor
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6124
  • Last login:June 23, 2022, 06:35:03 am
  • I only work in cyberspace...
    • Build Your Own Arcade Controls
Re: Unsure if bug or just me - pic displaying rotated
« Reply #5 on: March 11, 2019, 10:36:24 am »
Yes, that will fix it.

Thanks for the detailed explanation! Iíll start rotating and saving in a photoshop I guess. That should fix it?

--- John St.Clair
     Build Your Own Arcade Controls FAQ
     http://www.arcadecontrols.com/
     Project Arcade 2!
     http://www.projectarcade2.com/
     saint@arcadecontrols.com

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:June 01, 2022, 05:59:18 pm
  • <insert personal text here>
Re: Unsure if bug or just me - pic displaying rotated
« Reply #6 on: March 11, 2019, 05:59:15 pm »
So what I got from all that is...itís not a bug, itís a feature. I can buy that. Iíll get my photos Ďtated myself.