Fancybox image orientation [closed]

点点圈 提交于 2019-12-08 05:22:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!