问题
I have setup fancyapps-fancyBox-18d1712 on my website, and the frame display of portrait oriented images is wrong (they show up in landscape mode). If I select the image url from the frame for a portrait mode image and load it in a new browser tab, the image is correctly oriented. The behavior is the same in Firefox on Ubuntu, Chrome on OSX, Maxthon on OSX, and Safari on OSX.
Please advise. Thanks.
回答1:
Well, it's not a fancybox issue. There is something called JPEG EXIF Orientation Tag
(or flag).
Most modern cameras add this flag
to the image's EXIF information and some desktop software as well as some modern browsers (mobile browsers for sure) are able to read this flag and rotate the image (visually speaking) to display it properly, regardless the actual image format (portrait/landscape).
For reference, irfanview has an option that reads this flag if available
Enabling/disabling this option will display the image accordingly.
What you have to do is edit your images without reading the EXIF information and rotate them manually or save them without any EXIF information at all (you should rotate them manually in any case.) Then, you have to upload them again to your server.
It sounds annoying but it's the only way you can make sure that your images' format will be consistent through all different browsers and platforms (you wouldn't be the first person ranting about the issue, check this blog article)
You may also want to check this for further reference.
来源:https://stackoverflow.com/questions/17528227/fancybox-image-orientation