Sideways images be gone!!!


Anything goes - doesn't fit any other category!
  • Sponsored Links
Post Reply
User avatar
WingAdmin
Site Admin
Posts: 19421
Joined: Fri Oct 03, 2008 4:16 pm
Location: Strongsville, OH
Motorcycle: 2000 GL1500 SE
1982 GL1100A Aspencade (sold)
1989 PC800 (wife's!)
1998 XV250 Virago (sold)
2007 Aspen Sentry Trailer

Sideways images be gone!!!

Post by WingAdmin » Mon Jul 09, 2018 12:16 am



This one has been driving me crazy for months. I've finally cracked it - it was a bizarre error that came over from when we switched servers last.

In any case, images should no longer upload onto the site and show sideways (or worse) when they were taken that way.

Avatars work differently, and I'll still have to work on that one a bit more.

1:16 am, time to call it a night! :)



User avatar
AZgl1800
Posts: 1195
Joined: Thu Oct 30, 2008 2:46 pm
Location: Lake Oologah Indian Territory USA
Motorcycle: '02 GL1800

Re: Sideways images be gone!!!

Post by AZgl1800 » Mon Jul 09, 2018 1:08 am

it is aggravating when images come up that way....
I have GIMP set to "auto rotate" so when I get thru with an image, it is always right side up.
~John

User avatar
WingAdmin
Site Admin
Posts: 19421
Joined: Fri Oct 03, 2008 4:16 pm
Location: Strongsville, OH
Motorcycle: 2000 GL1500 SE
1982 GL1100A Aspencade (sold)
1989 PC800 (wife's!)
1998 XV250 Virago (sold)
2007 Aspen Sentry Trailer

Re: Sideways images be gone!!!

Post by WingAdmin » Mon Jul 09, 2018 7:53 am

AZgl1800 wrote:
Mon Jul 09, 2018 1:08 am
it is aggravating when images come up that way....
I have GIMP set to "auto rotate" so when I get thru with an image, it is always right side up.
The problem is modern digital cameras and smartphones have orientation sensors, so they know which way the camera was turned when the picture was taken. But instead of actually rotating the image when it is written to the memory, it writes out a regular "landscape" image - and then inserts data into the header of the image (called EXIF data, if you care) saying "rotate the image THIS way when it is displayed."

When the images are being processed during uploading to the site, this EXIF data is deleted, for privacy reasons - a lot of cameras (and especially smartphones) embed all kinds of stuff in the EXIF header that you don't necessarily want public. For instance, the exact lat/lon of where the picture was taken, that sort of thing. In doing so, the "rotate image THIS way" data was also being lost.

I had to rewrite the code to extract this rotation information and save it, then use it when processing the image so that the image would end up rotated correctly.

User avatar
landisr
Posts: 558
Joined: Tue Jul 28, 2009 12:18 pm
Location: Gilbert, AZ
Motorcycle: 1976 GL1000
1976 GL1000LTD
1994 GL1500A

Re: Sideways images be gone!!!

Post by landisr » Wed Jul 11, 2018 3:57 pm

Hi again, WingAdmin. Could you share anything about your code rewrite to extract and reuse the rotation code? My buddy that owns an HD forum might be able to incorporate something similar if you're willing to share. If not, I would understand. You can PM me if appropriate.

TIA. Ron
Beam me up, Scotty. There's no intelligent life down here.

topgun
Posts: 70
Joined: Fri Jul 31, 2009 10:24 pm
Location: sterling, il
Motorcycle: 2003 GL1800

Re: Sideways images be gone!!!

Post by topgun » Wed Jul 11, 2018 6:12 pm

You'd be my hero IF you could do same for idiots taking videos to send to the network news so the rest of the world can watch vertically shot images on a WIDESCREEN tv with 2 blurry images and the vertical in the center 1/3.



Post Reply