Keir Simmons
Keir Simmons

Reputation: 1684

HTML automatically rotating images on render

Can someone help me here. I have a PHP script which uploads an image and resizes it, and then an HTML page which displays the image. However, for some reason the HTML is rendering a rotated version of the image, although I can't for the life of me see why.

<div style="height:75px;width: 116px; background: url(http://viralsmods.com/pokeroulette/content/images/7.jpg);"></div>

Run the above snippet to see it in action. The image it is linked to is here: http://viralsmods.com/pokeroulette/content/images/7.jpg.

Any idea on why this could be?

Upvotes: 0

Views: 758

Answers (1)

TenneC
TenneC

Reputation: 48

The problem is related to EXIF (Exchangeable Image File Format) and the web browser

Basically, EXIF is a standard for holding file info such as which way an image should be rotated. Photos taken with (older) devices that do not use EXIF may not appear correctly in your web broswer.

The solution is to bring this file into photoshop, rotate as needed, save, then reupload for your site.

Upvotes: 1

Related Questions