1

在 PHP 中,我试图从图像中提取 EXIF 信息。在命令行与 mod_php 中执行相同的代码时,我得到了截然不同的结果。

在命令行中,我可以看到我需要的所有数据,但使用 mod_php 的数据很少。我想知道这与 mbstring 事情有关,但无法找出根本原因。

知道如何在 mod_php 中读取整个 Exif 数据吗?

$exif = exif_read_data($fileLoc, "EXIF", true);

foreach ($exif as $i => $value) {
    if( ) {
        error_log("Debug:: In $i");
        foreach ($value as $j => $jvalue){
            error_log("      Debug: $j => $jvalue");
        }
    }
    else {
        error_log("Debug: $i => $value");
    }
}

mod_php 输出:

 Debug:: In COMPUTED
       Debug: html => width="2592" height="1936"
       Debug: Height => 1936
       Debug: Width => 2592
       Debug: IsColor => 1 
       Debug: ByteOrderMotorola => 1
 Debug:: In IFD0
       Debug: Orientation => 1
       Debug: Exif_IFD_Pointer => 38
 Debug:: In EXIF
       Debug: ColorSpace => 1
       Debug: ExifImageWidth => 2592
       Debug: ExifImageLength => 1936

命令行输出:

<snip>
Debug:: In EXIF
      Debug: ExposureTime => 1/120
      Debug: FNumber => 14/5
      Debug: ExposureProgram => 2
      Debug: ISOSpeedRatings => 100
      Debug: ExifVersion => 0221
      Debug: DateTimeOriginal => 2012:01:12 15:30:57
      Debug: DateTimeDigitized => 2012:01:12 15:30:57
      Debug: ComponentsConfiguration => 
      Debug: ShutterSpeedValue => 12989/1880
      Debug: ApertureValue => 4281/1441
      Debug: BrightnessValue => 19112/3529
      Debug: MeteringMode => 5
      Debug: Flash => 16
      Debug: FocalLength => 77/20
      Debug: SubjectLocation => Array
      Debug: FlashPixVersion => 0100
      Debug: ColorSpace => 1
      Debug: ExifImageWidth => 2592
      Debug: ExifImageLength => 1936
      Debug: SensingMethod => 2
      Debug: ExposureMode => 0
      Debug: WhiteBalance => 0
      Debug: SceneCaptureType => 0
      Debug: Sharpness => 2
Debug:: In GPS
      Debug: GPSLatitudeRef => N
      Debug: GPSLatitude => Array
      Debug: GPSLongitudeRef => W
      Debug: GPSLongitude => Array
      Debug: GPSAltitudeRef => 
      Debug: GPSAltitude => 0/1
      Debug: GPSTimeStamp => Array
4

0 回答 0