可交换图像信息 业 ,精于勤 荒于嬉.

可交换图像信息 exif_imagetype 判断一个图像的类型

发表日期:2021-07-01 08:56:02 | 来源: | 分类:可交换图像信息

      示例1
1<?php
2if (exif_imagetype("image.gif") != IMAGETYPE_GIF) {
3    echo "The picture is not a gif";
4}
5?>

阅读全文 »

可交换图像信息 exif_read_data 从一个图片文件中读取 EXIF 头信息

发表日期:2021-07-01 08:56:02 | 来源: | 分类:可交换图像信息

      示例1
01<?php
02echo "test1.jpg:<br />\n";
03$exif = exif_read_data('tests/test1.jpg''IFD0');
04echo $exif===false ? "No header data found.<br />\n" "Image contains headers<br />\n";
05$exif = exif_read_data('tests/test2.jpg', 0, true);
06echo "test2.jpg:<br />\n";
07foreach ($exif as $key => $section) {
08    foreach ($section as $name => $val) {
09        echo "$key.$name: $val<br />\n";
10    }
11}
12?>
      示例2
01<?php
02// Open a the file, this should be in binary mode$fp = fopen('/path/to/image.jpg', 'rb');
03if (!$fp) {
04    echo 'Error: Unable to open image for reading';
05    exit;
06}
07// Attempt to read the exif headers$headers = exif_read_data($fp);
08if (!$headers) {
09    echo 'Error: Unable to read exif headers';
10    exit;
11}
12// Print the 'COMPUTED' headersecho 'EXIF Headers:' . PHP_EOL;
13foreach ($headers['COMPUTED'as $header => $value) {
14    printf(' %s => %s%s'$header$value, PHP_EOL);
15}
16?>

阅读全文 »

可交换图像信息 exif_tagname 获取指定索引的头名称

发表日期:2021-07-01 08:56:02 | 来源: | 分类:可交换图像信息

      示例1
1<?php
2echo "256: ".exif_tagname(256).PHP_EOL;
3echo "257: ".exif_tagname(257).PHP_EOL;
4?>

阅读全文 »

可交换图像信息 exif_thumbnail 取得嵌入在 TIFF 或 JPEG 图像中的缩略图

发表日期:2021-07-01 08:56:03 | 来源: | 分类:可交换图像信息

      示例1
01<?php
02if (array_key_exists('file',$_REQUEST)) {
03    $image = exif_thumbnail($_REQUEST['file'], $width$height$type);
04}
05 else {
06    $image = false;
07}
08if ($image!==false) {
09    header("Content-type: ".image_type_to_mime_type($type));
10    echo $image;
11    exit;
12}
13 else {
14    // no thumbnail available, handle the error here    echo "No thumbnail available";
15}
16?>

阅读全文 »

可交换图像信息 read_exif_data 别名 exif_read_data()

发表日期:2021-07-01 08:56:03 | 来源: | 分类:可交换图像信息

read_exif_data

(PHP 4 >= 4.0.1, PHP 5, PHP 7)

read_exif_data别名 exif_read_data()

警告

This alias was DEPRECATED in PHP 7.2.0, and REMOVED as of PHP 8.0.0.

说明

此函数是该函数的别名: exif_read_data().

更新日志

版本 说明
7.2.0 这个函数别名被废弃。

阅读全文 »

全部博文(1589)
集速网 copyRight © 2015-2022 宁ICP备15000399号-1 宁公网安备 64010402001209号
与其临渊羡鱼,不如退而结网
欢迎转载、分享、引用、推荐、收藏。