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

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

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

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

阅读全文 »

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

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

      示例1
<?php 
echo "test1.jpg:<br />\n";
$exif = exif_read_data('tests/test1.jpg', 'IFD0');
echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";
$exif = exif_read_data('tests/test2.jpg', 0, true);
echo "test2.jpg:<br />\n";
foreach ($exif as $key => $section) {
    foreach ($section as $name => $val) {
        echo "$key.$name: $val<br />\n";
    }
}
?>

      示例2
<?php 
// Open a the file, this should be in binary mode$fp = fopen('/path/to/image.jpg', 'rb');
if (!$fp) {
    echo 'Error: Unable to open image for reading';
    exit;
}
// Attempt to read the exif headers$headers = exif_read_data($fp);
if (!$headers) {
    echo 'Error: Unable to read exif headers';
    exit;
}
// Print the 'COMPUTED' headersecho 'EXIF Headers:' . PHP_EOL;
foreach ($headers['COMPUTED'] as $header => $value) {
    printf(' %s => %s%s', $header, $value, PHP_EOL);
}
?>

阅读全文 »

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

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

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

阅读全文 »

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

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

      示例1
<?php 
if (array_key_exists('file',$_REQUEST)) {
    $image = exif_thumbnail($_REQUEST['file'], $width, $height, $type);
}
 else {
    $image = false;
}
if ($image!==false) {
    header("Content-type: ".image_type_to_mime_type($type));
    echo $image;
    exit;
}
 else {
    // no thumbnail available, handle the error here    echo "No thumbnail available";
}
?>

阅读全文 »

可交换图像信息 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 这个函数别名被废弃。

阅读全文 »

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