从图像中提取元数据

时间:2020-11-07 21:25:28

标签: php

我在index.php中有代码,现在我只想从文件的元数据中获取版权,艺术家和imagedescirption。但是,当我尝试我拥有的代码时,只会显示以下内容:

EXIF Headers:
Array
(
    [FileName] => try.jpg
    [FileDateTime] => 1604783548
    [FileSize] => 78845
    [FileType] => 2
    [MimeType] => image/jpeg
    [SectionsFound] => ANY_TAG, IFD0, EXIF
    [COMPUTED] => Array
        (
            [html] => width="1348" height="345"
            [Height] => 345
            [Width] => 1348
            [IsColor] => 1
            [ByteOrderMotorola] => 1
            [UserComment] => free
            [UserCommentEncoding] => ASCII
            [Copyright] => nezzy
        )

    [ImageDescription] => description
    [ResolutionUnit] => 2
    [Artist] => btcall artist
    [YCbCrPositioning] => 1
    [Copyright] => nezzy
    [Exif_IFD_Pointer] => 118
    [ExifVersion] => 0231
    [ComponentsConfiguration] => 
    [UserComment] => ASCIIfree
    [FlashPixVersion] => 0100
    [UndefinedTag:0xA430] => batcall owen
)

但是我只对版权,艺术家和图像描述感兴趣。 这是我的代码:

<?php 

// Open a the file from local folder 
$fp = fopen('try.jpg', 'rb'); 

// Read the exif headers 
$headers = exif_read_data($fp); 

// Print the headers 
echo 'EXIF Headers:' . '<br>'; 

print("<pre>".print_r($headers, true)."</pre>"); 
?> 

0 个答案:

没有答案
相关问题