How to prevent Image  rotation Html5

Posted on 2015-01-02
Medium Priority
Last Modified: 2015-01-03
Portrait pictures get rotated?


Please how do I Prevent this? - display without rotation. I just want the picture to display as is.

When I look at the original it is OK see below - it is portrait - see here:

<IMG ID="DataField40" SRC="/pics/2145674015_6.jpg?ref=4096"  
ALT="House Sitters Pictures from YouthfulRetiree">

Open in new window

Question by:Ian White
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40529089
it has to do with the meta data in the image which was put there by the camera it was taken with. If you only have a few images the easiest way to 'fix' it is to open the images in phoshop and resave.

if these are client images and you have no control over them, you can manipulate the rotation server side.

as far as i remember there is no way to have html5 ignore the rotation, but u could be wrong.
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 40529090
oops, i meant, "i could be wrong"
LVL 53

Expert Comment

ID: 40529249
You might be able to fix it with a CSS transform. Try changing the CSS for the images to include:


Open in new window

If it does not work when applied directly to the images, you can try rotating the container for the images instead.

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.


Author Comment

by:Ian White
ID: 40529580
They are client posted images dynamically loaded.  So the logic would apply to thousands of pictures, loaded by clients  for the same page .

I am not sure why the meta data of the image would cause it to flip unnaturally? so the picture cant be seen as taken?

I thought maybe it was the css for the page?  Maybe it couldnt fit so it rotated? Not an expert on CSS

Author Comment

by:Ian White
ID: 40529582
It does not happen for most images posted by clients  - just some

Author Comment

by:Ian White
ID: 40529588
So this is an example of the same page where the image is ok - for another client

LVL 25

Accepted Solution

Kyle Hamilton earned 2000 total points
ID: 40529785
you will need a server solution. the reason only some images appear flipped is becuase the cameras are different. this is meta data set by the camera - nothing to do with CSS.

i could give you a php solution, but it looks like you are using cold fusion, so that would probably be no use to you.

while you can do rotation client side, you would need to wait until the image is loaded to get the exif_data to determine whether to rotate or not. imo, lots of unnecessary work that's better left to the server

Author Comment

by:Ian White
ID: 40529876
I dont seem to be able to add coldfusion as topic  Should I close this and reopen in coldfusion?

Author Closing Comment

by:Ian White
ID: 40529889
Thanks for your help. I will repost as a cold fusion problem

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question