0

所以,这两天我一直在失去理智。我有一个基于 Drupal 7 的网站。

我遇到的问题是,当我的网站用户从 iPhone 或 iPad 上传图像(通过 ckeditor 和通过表单上传的帐户个人资料图像)时,图像最终被颠倒了。

当我注意到一个奇怪的问题时,我已经编写了独立的 php 来读取图像的 exif 数据并检测问题。当不在drupal中时,图像确实有exif信息,并且一旦上传到drupal,它们似乎就会丢失exif信息。

我使用此代码读取 exif 信息

$full_filename ='image.jpg';
$exif = exif_read_data($full_filename);

print "<pre>";
    print_r($exif);
print "<pre>";

这是从未上传到 drupal 的图像中读取的结果

Array
(
    [FileName] => image4.jpg
    [FileDateTime] => 1372430458
    [FileSize] => 1568098
    [FileType] => 2
    [MimeType] => image/jpeg
    [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF
    [COMPUTED] => Array
        (
            [html] => width="2592" height="1936"
            [Height] => 1936
            [Width] => 2592
            [IsColor] => 1
            [ByteOrderMotorola] => 1
            [ApertureFNumber] => f/2.8
            [Thumbnail.FileType] => 2
            [Thumbnail.MimeType] => image/jpeg
        )

    [Make] => Apple
    [Model] => iPhone 4
    [Orientation] => 6
    [XResolution] => 72/1
    [YResolution] => 72/1
    [ResolutionUnit] => 2
    [Software] => 5.1.1
    [DateTime] => 2013:06:28 09:18:53
    [YCbCrPositioning] => 1
    [Exif_IFD_Pointer] => 192
    [THUMBNAIL] => Array
        (
            [Compression] => 6
            [XResolution] => 72/1
            [YResolution] => 72/1
            [ResolutionUnit] => 2
            [JPEGInterchangeFormat] => 676
            [JPEGInterchangeFormatLength] => 8886
        )

    [ExposureTime] => 1/24
    [FNumber] => 14/5
    [ExposureProgram] => 2
    [ISOSpeedRatings] => 80
    [ExifVersion] => 0221
    [DateTimeOriginal] => 2013:06:28 09:18:53
    [DateTimeDigitized] => 2013:06:28 09:18:53
    [ComponentsConfiguration] => 
    [ShutterSpeedValue] => 21632/4717
    [ApertureValue] => 4281/1441
    [BrightnessValue] => 94810/26881
    [MeteringMode] => 5
    [Flash] => 24
    [FocalLength] => 77/20
    [SubjectLocation] => Array
        (
            [0] => 1295
            [1] => 967
            [2] => 699
            [3] => 696
        )

    [FlashPixVersion] => 0100
    [ColorSpace] => 1
    [ExifImageWidth] => 2592
    [ExifImageLength] => 1936
    [SensingMethod] => 2
    [ExposureMode] => 0
    [WhiteBalance] => 0
    [SceneCaptureType] => 0
    [Sharpness] => 2
)

这是上传到drupal的图像中的信息

Array
(
    [FileName] => image3.jpg
    [FileDateTime] => 1372355645
    [FileSize] => 75670
    [FileType] => 2
    [MimeType] => image/jpeg
    [SectionsFound] => COMMENT
    [COMPUTED] => Array
        (
            [html] => width="1024" height="765"
            [Height] => 765
            [Width] => 1024
            [IsColor] => 1
        )

    [COMMENT] => Array
        (
            [0] => CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 75

        )

)

有没有可能drupal与此有关。GD 工具包?

我尝试使用 imagecache autorotate 并旋转未从 iphone 上传的图像,但 ipad 或 iphone 没有运气。

我不确定如何开始。欢迎所有帮助。

4

1 回答 1

0

你没有看到东西。

iPhone/Pad 在发送图像时会去除 EXIF 信息。

从 iPhone 上传的图像会去除 exif 数据

EXIF 自定义模块可能会有所帮助。

https://drupal.org/project/exif_custom

ImageCache 操作也是如此

https://drupal.org/project/imagecache_actions

于 2013-07-20T22:52:44.430 回答