Currently working on a new project using Twitter Bootstrap. The main focus is on a thumbnail gallery, similar to the examples provided by Bootstrap (found here: ).
The issue I am facing involves applying css transformations, particularly rotations, to images based on their EXIF orientation data. When I rotate an image (using -webkit-transform for testing in Chrome), the parent element of the image remains the same, causing the image to "overflow" its container.
In Chrome, you can replicate this behavior by visiting the example thumbnail gallery link mentioned earlier, inspecting one of the placeholder images, and adding a
style="-webkit-transform: rotate(90deg)"
property to the img
tag. This causes the image to overflow the li
container and disrupt the layout.
Is there a solution to have bootstrap recognize a css-rotated image as if it were originally that way? One idea was manually setting the height and width of the img
tag, but since the server-side rendering size is unknown beforehand, this approach seems impractical.
Although rotating the images on the server-side is possible, I strongly prefer achieving this effect in the browser.
Any suggestions or ideas would be greatly appreciated!
EDIT: A suggestion was made to rotate the entire container, however, this method would also rotate any text nodes inside the thumbnail li
s which is not desirable.