PHP-Fusion
v.7.01
AP-Fusion
v7.02.05
Pimped-Fusion-AP
v0.09.03
November 29 2024 09:58:36
Авторизация
Логин

Пароль



Вы не зарегистрированы?
Нажмите здесь для регистрации.

Забыли пароль?
Запросите новый здесь.
Мини-чат
Вы должны авторизироваться, чтобы добавить сообщение.

lom
06/04/2018 14:03
Мы рады, ждем девятку. Очень хочется пощупать

Alipapa
27/03/2018 22:16
Всем привет, все неисправности устранили, всё у нас работает

mukaton
30/10/2015 02:37
Не получается ничего скачать. Ошибка Not Found

Alipapa
06/10/2015 23:00
9-я версия php-fusion на подходе, следите за новостями

Alipapa
10/11/2014 11:24
Заметь, я дважды ответил через 3 минуты после вопроса, могли бы уже решить

Последние статьи
· О стабилизаторах нап...
· СМС и Вебмани
· TinyMCE для пользова...
· PCRE (Perl Compatibl...
· PCRE (Perl Compatibl...
Последние активные темы форума
  Темы Просмотров Ответов Последние сообщения
PHP-Fusion 7 Bogatyr - бесп...
Моды, плагины
7760 1 Vveb--ws
08-10-2018 16:47
Php-Fusion v9. Первые впеча...
Вопросы по работе
5032 3 Vveb--ws
25-07-2018 13:46
Появился хэлп по PHP-Fusion...
Вопросы по работе
7197 7 Vveb--ws
25-07-2018 13:42
prestashop&ap-fusion
Вопросы по работе
18330 61 Alipapa
26-08-2014 10:29
Плагин магазина Ap-Shop
Моды, плагины
15376 70 Alipapa
18-08-2014 18:14
TinyMCE
Вопросы по работе
21958 55 Alipapa
27-07-2013 21:57
HTML-5
Моды, плагины
5794 1 Alipapa
15-06-2013 19:47
Мультиязычность в Pimped-Fu...
Ошибки, баги, глюки
6681 4 Papich
16-04-2013 12:39
Pimped-Fusion. Первые впеча...
Ошибки, баги, глюки
23380 127 Alipapa
18-12-2012 10:59
Ищу мод для расстановки код...
Моды, плагины
15634 55 Alipapa
17-09-2012 14:00
Как присоединить файл к лич...
Моды, плагины
8553 3 lom
27-05-2012 18:12
Что мне не нравится в после...
Вопросы по работе
7157 4 Alipapa
27-05-2012 18:08
Проблемы с добавлением кате...
Вопросы по работе
8124 5 Alipapa
27-05-2012 18:06

exif_read_data

(PHP 4 >= 4.2.0, PHP 5)

exif_read_data -- Reads the EXIF headers from JPEG or TIFF

Описание

array exif_read_data ( string filename [, string sections [, bool arrays [, bool thumbnail]]] )

exif_read_data() reads the EXIF headers from a JPEG or TIFF image file. This way you can read meta data generated by digital cameras.

Exif headers tend to be present in JPEG/TIFF images generated by digital cameras, but unfortunately each digital camera maker has a different idea of how to actually tag their images, so you can't always rely on a specific Exif header being present.

Height and Width are computed the same way getimagesize() does so their values must not be part of any header returned. Also, html is a height/width text string to be used inside normal HTML.

When an Exif header contains a Copyright note, this itself can contain two values. As the solution is inconsistent in the Exif 2.10 standard, the COMPUTED section will return both entries Copyright.Photographer and Copyright.Editor while the IFD0 sections contains the byte array with the NULL character that splits both entries. Or just the first entry if the datatype was wrong (normal behaviour of Exif). The COMPUTED will also contain the entry Copyright which is either the original copyright string, or a comma separated list of the photo and editor copyright.

The tag UserComment has the same problem as the Copyright tag. It can store two values. First the encoding used, and second the value itself. If so the IFD section only contains the encoding or a byte array. The COMPUTED section will store both in the entries UserCommentEncoding and UserComment. The entry UserComment is available in both cases so it should be used in preference to the value in IFD0 section.

Замечание: Windows ME/XP can both wipe the Exif headers when connecting to a camera. More information available at http://www.canon.co.jp/Imaging/NOTICE/011214-e.html.

Список параметров

filename

The name of the image file being read. This cannot be an URL.

sections

Is a comma separated list of sections that need to be present in file to produce a result array. If none of the requested sections could be found the return value is FALSE.

FILEFileName, FileSize, FileDateTime, SectionsFound
COMPUTEDhtml, Width, Height, IsColor, and more if available. Height and Width are computed the same way getimagesize() does so their values must not be part of any header returned. Also, html is a height/width text string to be used inside normal HTML.
ANY_TAGAny information that has a Tag e.g. IFD0, EXIF, ...
IFD0All tagged data of IFD0. In normal imagefiles this contains image size and so forth.
THUMBNAILA file is supposed to contain a thumbnail if it has a second IFD. All tagged information about the embedded thumbnail is stored in this section.
COMMENTComment headers of JPEG images.
EXIFThe EXIF section is a sub section of IFD0. It contains more detailed information about an image. Most of these entries are digital camera related.

arrays

Specifies whether or not each section becomes an array. The sections COMPUTED, THUMBNAIL, and COMMENT always become arrays as they may contain values whose names conflict with other sections.

thumbnail

When set to TRUE the thumbnail itself is read. Otherwise, only the tagged data is read.

Возвращаемые значения

It returns an associative array where the array indexes are the header names and the array values are the values associated with those headers. If no data can be returned, exif_read_data() will return FALSE.

Список изменений

ВерсияОписание
4.3.0Can read all embedded IFD data including arrays (returned as such). Also the size of an embedded thumbnail is returned in a THUMBNAIL subarray, and can return thumbnails in TIFF format. Also, there is no longer a maximum length for returned values (not until the memory limit has been reached)
4.3.0If PHP has mbstring support, the user comment can automatically change encoding. Also, if the user comment uses Unicode or JIS encoding this encoding will automatically be changed according to the exif ini settings in php.ini
4.3.0If the image contains any IFD0 data then COMPUTED contains the entry ByteOrderMotorola which is 0 for little-endian (intel) and 1 for big-endian (motorola) byte order. Also, COMPUTED and UserComment no longer only contain the first copyright entry if the datatype was wrong.

Примеры

Пример 1. exif_read_data() example

<?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 " ;
    }
}
?>

The first call fails because the image has no header information.

Результатом выполнения данного примера будет что-то подобное:

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

Смотрите также

exif_thumbnail()
getimagesize()

Все функции PHP:
Навигация
· Новости
· Статьи
· Скачать
· Форум
· Ссылки
· Категории новостей
· Обратная связь
· Галерея
· Поиск
· CMS AP-Fusion. Отличия от PHP-Fusion
· Javascript справочник
· Техника
Сейчас на сайте
· Гостей: 17

· Пользователей: 0

· Всего пользователей: 453
· Новый пользователь: ZDA
Информеры
Загрузка файлов  +  -
10,253,513 уникальных посетителей Iceberg by Harly