Go to the source code of this file.
Enumerations | |
enum | EXIF_ASCII |
enum | EXIF_SHORT |
enum | EXIF_LONG |
enum | EXIF_RATIONAL |
enum | EXIF_SBYTE |
enum | EXIF_UNDEFINED |
enum | EXIF_SSHORT |
enum | EXIF_SLONG |
enum | EXIF_SRATIONAL |
enum | EXIF_LSEEK_ENABLE |
Functions | |
hexdump ($data) | |
======================================= Functions ====================================== | |
print_directory ($dir_entries) | |
test_print_header () | |
test_print_directory () | |
start_ifd ($count) | |
finish_ifd () | |
addDirEntry ($ifd_entry) | |
substitute_value ($ifd_entry) | |
process_ifd_entry ($ifd_entry, $group) | |
Variables | |
$ExifDeviceTemplateFilename = "/dev/exif_template" | |
$ExifDeviceMetadirFilename = "/dev/exif_metadir" | |
$ExifDeviceExifFilename = "/dev/exif_exif" | |
$ExifDeviceMetaFilename = "/dev/exif_meta" | |
$ExifXMLName = "/etc/Exif_template.xml" | |
$init = false | |
$init = true | |
$noGPS = ($_GET["noGPS"]!==NULL) | |
$nocompass = ($_GET["nocompass"]!==NULL) | |
$Exif_length_offset = 2 | |
$exif_data | |
$xml_exif = simplexml_load_file($ExifXMLName) | |
$IFD_offset = count($exif_data) | |
$SUB_IFD_offset = 12*count($xml_exif->Image->children())+2+4+$IFD_offset | |
$GPSInfo_offset = 12*count($xml_exif->Photo->children())+2+4+$SUB_IFD_offset | |
$data_offset = $GPSInfo_offset+(($xml_exif->GPSInfo)?(12*count($xml_exif->GPSInfo->children())+2+4):0) | |
$ifd_pointer = $IFD_offset | |
$data_pointer = $data_offset | |
$ifd_pointer = $SUB_IFD_offset | |
$exif_len = count($exif_head)+count($exif_data)-$Exif_length_offset | |
$exif_head [$Exif_length_offset] = ($exif_len >> 8) & 0xff | |
$exif_head [$Exif_length_offset+1] = $exif_len & 0xff | |
$Exif_str = "" | |
$Exif_file = fopen($ExifDeviceTemplateFilename, 'w') | |
$dir_sequence = array() | |
Exif template is done, now we need a directory to map frame meta data to fields in the template. | |
$dir_entries = array() | |
$frame_meta_size = 0 | |
$Exif_meta_file = fopen($ExifDeviceMetadirFilename, 'w') | |
$Exif_file = fopen($ExifDeviceTemplateFilename, 'w') | |
Rebuild buffer and enable Exif generation/output:. | |
$metadir = fread ($Exif_file, 4096) | |
$dir_entries = array() |
enum EXIF_ASCII |
enum EXIF_LSEEK_ENABLE |
enum EXIF_RATIONAL |
enum EXIF_SBYTE |
enum EXIF_SHORT |
enum EXIF_SLONG |
enum EXIF_SRATIONAL |
enum EXIF_SSHORT |
enum EXIF_UNDEFINED |
addDirEntry | ( | $ | ifd_entry | ) |
Definition at line 431 of file exif.php.
References $dir_entries, $dir_sequence, $exif_head, and min.
finish_ifd | ( | ) |
hexdump | ( | $ | data | ) |
======================================= Functions ======================================
Definition at line 326 of file exif.php.
References $d, $data, $exif_data, and $exif_head.
print_directory | ( | $ | dir_entries | ) |
process_ifd_entry | ( | $ | ifd_entry, | |
$ | group | |||
) |
Definition at line 476 of file exif.php.
References $a, $d, $data_pointer, $exif_data, $GPSInfo_offset, $ifd_pointer, $SUB_IFD_offset, and value.
start_ifd | ( | $ | count | ) |
substitute_value | ( | $ | ifd_entry | ) |
Definition at line 449 of file exif.php.
References $GPSInfo_offset, $s, $SUB_IFD_offset, and value.
test_print_directory | ( | ) |
test_print_header | ( | ) |
$data_offset = $GPSInfo_offset+(($xml_exif->GPSInfo)?(12*count($xml_exif->GPSInfo->children())+2+4):0) |
$data_pointer = $data_offset |
$dir_entries = array() |
Definition at line 210 of file exif.php.
Referenced by addDirEntry(), print_directory(), and test_print_directory().
$dir_sequence = array() |
Exif template is done, now we need a directory to map frame meta data to fields in the template.
Definition at line 209 of file exif.php.
Referenced by addDirEntry().
$exif_data |
Initial value:
array (// start of TIFF Header, data offsets will match indexes in this array 0x4d,0x4d, // (MM) Big endian, MSB goes first in multi-byte data 0x00,0x2a, // Tag Mark 0x00,0x00,0x00,0x08)
Definition at line 143 of file exif.php.
Referenced by finish_ifd(), hexdump(), process_ifd_entry(), start_ifd(), and test_print_header().
$Exif_file = fopen($ExifDeviceTemplateFilename, 'w') |
$exif_head[$Exif_length_offset] = ($exif_len >> 8) & 0xff |
Definition at line 197 of file exif.php.
Referenced by addDirEntry(), hexdump(), and test_print_header().
$exif_len = count($exif_head)+count($exif_data)-$Exif_length_offset |
$ExifDeviceTemplateFilename = "/dev/exif_template" |
! FILE NAME : exif.php ! DESCRIPTION: This program collects information about the camera (version, software, sensor) ! and combines it with the Exif template (default is /etc/Exif_template.xml) to prepare generation ! of Exif headers. ! It works in a command line with a single optional parameter - location of the template file and ! trough the CGI interface. In that case it accepts the following parameter ! init - program Exif with default /etc/Exif_template.xml ! init=path - program Exif with alternative file ! noGPS - don't include GPS-related fields ! nocompass - don't include compass-related fields ! template - print currently loaded template data (hex dump) ! metadir - print currently loaded meta directory that matches variable Exif fields with the template ! exif=0 - print current Exif page (updated in real time) ! exif=NNN - print one of the Exif pages in the buffer (debug feature, current buffer pointer is not known here) ! ! Copyright (C) 2007-2008 Elphel, Inc ! -----------------------------------------------------------------------------** ! ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** !
$ExifXMLName = "/etc/Exif_template.xml" |
$frame_meta_size = 0 |
$GPSInfo_offset = 12*count($xml_exif->Photo->children())+2+4+$SUB_IFD_offset |
$ifd_pointer = $IFD_offset |
Definition at line 179 of file exif.php.
Referenced by finish_ifd(), process_ifd_entry(), and start_ifd().
$SUB_IFD_offset = 12*count($xml_exif->Image->children())+2+4+$IFD_offset |