exif_tagname

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

exif_tagnameObtém o nome do cabeçalho para um índice

Descrição

exif_tagname(int $index): string|false

Parâmetros

index

O ID da marca para o qual o nome do cabeçalho será pesquisado

Valor Retornado

Retorna o nome do cabeçalho, ou false se index não for um id de marca EXIF definido.

Exemplos

Exemplo #1 Exemplo de exif_tagname()

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

O exemplo acima produzirá:

256: ImageWidth
257: ImageLength

Veja Também

add a note add a note

User Contributed Notes 2 notes

up
0
abc at ed48 dot com
12 years ago
In association with exif_read_data:

<?php

# The tagnames can vary in different cameras

$imgdir = "/path_to_img/";
$img_file = "image_file.jpg";

echo
$img_file . "&nbsp;&nbsp;&nbsp;<sub>TEST</sub>
<br />"
;
echo
'<img src="' . $imgdir . $img_file . '" alt="'
. $img_file . '" title="' . $img_file . '" width="400" /><br /><br />';

$xf_data = exif_read_data($imgdir . $img_file);

$tagg = exif_tagname(0X10F);
echo
'<br>' . $tagg ' >>> ' . $xf_data[$tagg];
$tagg = exif_tagname(0X110);
echo
'<br>' . $tagg ' >>> ' . $xf_data[$tagg];
$tagg = exif_tagname(0X132);
echo
'<br>' . $tagg ' >>> ' . $xf_data[$tagg];
$tagg = exif_tagname(0XA002);
echo
'<br>' . $tagg ' >>> ' . $xf_data[$tagg] . 'px';
$tagg = exif_tagname(0XA003);
echo
'<br>' . $tagg ' >>> ' . $xf_data[$tagg] . 'px';

?>
up
0
abc at ed48 dot com
12 years ago
Theoretically, 65,535 tags are possible. Although not all are used, yet. The code below lists these tags:

<?php

for ($id = 1; $id <= 65535; $id++)
{
$dec2hex = dechex($id);

$strgx = '0x'. $dec2hex;

if(
exif_tagname($strgx) != "")
{
echo
$strgx . ' ( ' . exif_tagname($strgx) . ' )<br />';
}
}

?>
To Top