php获取图片的exif信息
Libérer: 2016-07-25 08:45:14
original
1010 Les gens l'ont consulté
php获取图片的exif信息,php自带一个exif_read_data函数可以用来读取图片的exif信息
-
echo "test1.jpg:
\n";
- $exif = exif_read_data('tests/test1.jpg', 'IFD0');
- echo $exif===false ? "No header data found.
\n" : "Image contains headers \n";
-
- $exif = exif_read_data('tests/test2.jpg', 0, true);
- echo "test2.jpg:
\n";
- foreach ($exif as $key => $section) {
- foreach ($section as $name => $val) {
- echo "$key.$name: $val
\n";
- }
- }
- ?>
复制代码
输出结果如下
- test1.jpg:
- No header data found.
- test2.jpg:
- FILE.FileName: test2.jpg
- FILE.FileDateTime: 1017666176
- FILE.FileSize: 1240
- FILE.FileType: 2
- FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, COMMENT
- COMPUTED.html: width="1" height="1"
- COMPUTED.Height: 1
- COMPUTED.Width: 1
- COMPUTED.IsColor: 1
- COMPUTED.ByteOrderMotorola: 1
- COMPUTED.UserComment: Exif test image.
- COMPUTED.UserCommentEncoding: ASCII
- COMPUTED.Copyright: Photo (c) M.Boerger, Edited by M.Boerger.
- COMPUTED.Copyright.Photographer: Photo (c) M.Boerger
- COMPUTED.Copyright.Editor: Edited by M.Boerger.
- IFD0.Copyright: Photo (c) M.Boerger
- IFD0.UserComment: ASCII
- THUMBNAIL.JPEGInterchangeFormat: 134
- THUMBNAIL.JPEGInterchangeFormatLength: 523
- COMMENT.0: Comment #1.
- COMMENT.1: Comment #2.
- COMMENT.2: Comment #3end
- THUMBNAIL.JPEGInterchangeFormat: 134
- THUMBNAIL.Thumbnail.Height: 1
- THUMBNAIL.Thumbnail.Height: 1
复制代码
|
php, exif
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Derniers articles par auteur
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31