可交换图像信息 业 ,精于勤 荒于嬉.
- 可交换图像信息 exif_imagetype 判断一个图像的类型
-
发表日期:2021-07-01 08:56:02 | 来源: | 分类:可交换图像信息
-
示例1
1
<?php
2
if
(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
02
echo
"test1.jpg:<br />\n"
;
03
$exif
= exif_read_data(
'tests/test1.jpg'
,
'IFD0'
);
04
echo
$exif
===false ?
"No header data found.<br />\n"
:
"Image contains headers<br />\n"
;
05
$exif
= exif_read_data(
'tests/test2.jpg'
, 0, true);
06
echo
"test2.jpg:<br />\n"
;
07
foreach
(
$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');
03
if
(!
$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);
08
if
(!
$headers
) {
09
echo
'Error: Unable to read exif headers'
;
10
exit
;
11
}
12
// Print the 'COMPUTED' headersecho 'EXIF Headers:' . PHP_EOL;
13
foreach
(
$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
2
echo
"256: "
.exif_tagname(256).PHP_EOL;
3
echo
"257: "
.exif_tagname(257).PHP_EOL;
4
?>
- 可交换图像信息 exif_thumbnail 取得嵌入在 TIFF 或 JPEG 图像中的缩略图
-
发表日期:2021-07-01 08:56:03 | 来源: | 分类:可交换图像信息
-
示例1
01
<?php
02
if
(
array_key_exists
(
'file'
,
$_REQUEST
)) {
03
$image
= exif_thumbnail(
$_REQUEST
[
'file'
],
$width
,
$height
,
$type
);
04
}
05
else
{
06
$image
= false;
07
}
08
if
(
$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 | 来源: | 分类:可交换图像信息
-
警告
This alias was DEPRECATED in PHP 7.2.0, and REMOVED as of PHP 8.0.0.
说明
此函数是该函数的别名: exif_read_data().
更新日志
版本 说明 7.2.0 这个函数别名被废弃。
- PHP杂项(34)
- PHP基础-李炎恢系列课程(20)
- 中文函数手册(0)
- 错误处理 函数(13)
- OPcache 函数(6)
- PHP 选项/信息 函数(54)
- Zip 函数(10)
- Hash 函数(15)
- OpenSSL 函数(63)
- Date/Time 函数(51)
- 目录函数(9)
- Fileinfo 函数(6)
- iconv 函数(11)
- 文件系统函数(81)
- 多字节字符串 函数(57)
- GD 和图像处理 函数(114)
- 可交换图像信息(5)
- Math 函数(50)
- 程序执行函数(11)
- PCNTL 函数(23)
- JSON 函数(4)
- SPL 函数(15)
- URL 函数(10)
- cURL 函数(32)
- 网络 函数(33)
- FTP 函数(36)
- Session 函数(23)
- PCRE 函数(11)
- PCRE 正则语法(19)
- 数组 函数(81)
- 类/对象 函数(18)
- 函数处理 函数(13)
- 变量处理 函数(37)
- SimpleXML 函数(3)
- 杂项 函数(31)
- 字符串 函数(101)