< IMG>不需要的照片旋转 [英] <img> unwanted photo rotation

查看:125
本文介绍了< IMG>不需要的照片旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用HTML5在表格中嵌入了一个图像。逆时针旋转图像自动旋转90度,没有应用CSS,也没有Javascript(以前是某些标签上的 class 参数,但我在< head> 中注明了< style>< / style> 块。

I have an image embedded in a table using HTML5. The image is being rotated automatically 90deg counterclockwise, and there is no CSS being applied, nor Javascript (there used to be, hence the class parameters on some of the tags, but I commented out the <style></style> block in the <head>.

图像是由带有Imagick的PHP脚本创建的,可以将其从原始图像缩小,但原始图像仍然存在同样的问题。

The image was created by a PHP script w/ Imagick to scale it down from the original image, but the original image still had the same problem.

代码:

<table>
    <tr>
        <th>$username has sent you a photo!</th>
    </tr>
    <tr>
        <td>
            <img src="IMG_1314_MOD.jpg" width="300" height="225" class="rotate90"/>
        </td>
    </tr>
    <tr>
        <td><div class="caption">$caption</div></td>
    </tr>
</table>

我特里d使用此答案中的CSS代码并将其应用于< img> ,但是当它旋转时,它没有调整表格,并且覆盖了文本。

I tried using the CSS code in this answer and applied it to the <img>, but when it rotated, it didn't adjust the table, and covered up the text.

有没有人知道我可以解决这个问题使用?

Does anybody know of a solution to this that I could use?

- 编辑 -

我使用了EXIF扩展程序PHP到 print_r()图像上的EXIF标题,似乎没有任何方向标题。标题可以在Pastebin 这里上找到,如果您不介意仔细检查,无论谁阅读此内容。

I used the EXIF extension with PHP to print_r() the EXIF headers on the image, and there didn't seem to be any orientation headers. The headers can be found on Pastebin here if you wouldn't mind double-checking, whoever may read this.

推荐答案

在JPG图像上运行 jhead -autorot 。这就是我在将图像放到网上之前处理自动旋转的方法。

Run jhead -autorot on your JPG image. That's what I do to handle autorotation before putting my images on the web.

这将按照相机的方向传感器的指定旋转图像,然后重置方向标记,以便它不会被意外地再次旋转。

This will rotate the image as specified by the camera's orientation sensor, then reset the orientation flag so that it will not be accidentally rotated again.

http://www.sentex.net/~mwandel/jhead/usage.html

(注意,我从不自动旋转我的原件,只是缩放版本作为我的脚本的一部分,用于将它们发送到网络。)

(Note, I never autorotate my originals, just the scaled versions as part of my script for sending them to the web.)

这篇关于&LT; IMG&GT;不需要的照片旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆