Drupal 7,iPhone的图像方向搞砸了 - 没有exif信息

问题描述:

因此,我已经失去了两天的思想。我必须建立在Drupal的7Drupal 7,iPhone的图像方向搞砸了 - 没有exif信息

我有这个问题一个网站,当我的网站用户上传从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信息。

Image upload from iphone strips exif data

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

https://drupal.org/project/exif_custom

所以可能ImageCache操作

https://drupal.org/project/imagecache_actions