Drupal 7,iPhone图像方向混乱-没有exif信息



所以,两天来我一直在为这个失去理智。我有一个建立在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自动旋转,它会旋转未从iphone上传的图像,但在ipad或iphone上没有成功。

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

您没有看到任何东西。

iPhone/Pad在发送图像时会剥离EXIF信息。

图片上传从iphone剥离exif数据

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

https://drupal.org/project/exif_custom

ImageCache Actions 也是如此

https://drupal.org/project/imagecache_actions

最新更新