Solved

How to prevent Image  rotation Html5

Posted on 2015-01-02
9
223 Views
Last Modified: 2015-01-03
Portrait pictures get rotated?

http://www.housecarers.com/photo_view2.cfm?mem=2145674015&slide=6

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:
http://housecarers.com/pics/2145674015_6.jpg?ref=%227842%22

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

Open in new window




Thanks
Ian
0
Comment
Question by:Ian White
  • 5
  • 3
9 Comments
 
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.
0
 
LVL 25

Expert Comment

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

Expert Comment

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

-webkit-transform:rotate(90deg); 
transform:rotate(90deg);

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.

Cd&
0
 

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
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

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

Author Comment

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

http://www.housecarers.com/photo_view2.cfm?mem=2145661960&slide=4
0
 
LVL 25

Accepted Solution

by:
Kyle Hamilton earned 500 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
0
 

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?
0
 

Author Closing Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
P tag not forcing line space 2 23
Centered Image 2 23
Wrapper for APPs 9 37
ASP.net Fit 3 divs on screen side by side 3 4
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now