apps/web/imgsrv/exif.php File Reference

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()


Enumeration Type Documentation

enum EXIF_ASCII

Definition at line 122 of file exif.php.

enum EXIF_LONG

Definition at line 124 of file exif.php.

enum EXIF_LSEEK_ENABLE

Definition at line 132 of file exif.php.

enum EXIF_RATIONAL

Definition at line 125 of file exif.php.

enum EXIF_SBYTE

Definition at line 126 of file exif.php.

enum EXIF_SHORT

Definition at line 123 of file exif.php.

enum EXIF_SLONG

Definition at line 129 of file exif.php.

enum EXIF_SRATIONAL

Definition at line 130 of file exif.php.

enum EXIF_SSHORT

Definition at line 128 of file exif.php.

enum EXIF_UNDEFINED

Definition at line 127 of file exif.php.


Function Documentation

addDirEntry ( ifd_entry  ) 

Definition at line 431 of file exif.php.

References $dir_entries, $dir_sequence, $exif_head, and min.

finish_ifd (  ) 

Definition at line 420 of file exif.php.

References $exif_data, and $ifd_pointer.

hexdump ( data  ) 

======================================= Functions ======================================

Definition at line 326 of file exif.php.

References $d, $data, $exif_data, and $exif_head.

print_directory ( dir_entries  ) 

Definition at line 357 of file exif.php.

References $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  ) 

Definition at line 414 of file exif.php.

References $exif_data, and $ifd_pointer.

substitute_value ( ifd_entry  ) 

Definition at line 449 of file exif.php.

References $GPSInfo_offset, $s, $SUB_IFD_offset, and value.

test_print_directory (  ) 

Definition at line 401 of file exif.php.

References $dir_entries, and $frame_meta_size.

test_print_header (  ) 

Definition at line 369 of file exif.php.

References $d, $exif_data, and $exif_head.


Variable Documentation

$data_offset = $GPSInfo_offset+(($xml_exif->GPSInfo)?(12*count($xml_exif->GPSInfo->children())+2+4):0)

Definition at line 164 of file exif.php.

$data_pointer = $data_offset

Definition at line 180 of file exif.php.

Referenced by process_ifd_entry().

$dir_entries = array()

Definition at line 258 of file exif.php.

$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')

Rebuild buffer and enable Exif generation/output:.

Definition at line 233 of file exif.php.

$Exif_file = fopen($ExifDeviceTemplateFilename, 'w')

Definition at line 204 of file exif.php.

$exif_head[$Exif_length_offset+1] = $exif_len & 0xff

Definition at line 198 of file exif.php.

$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

Definition at line 196 of file exif.php.

$Exif_length_offset = 2

Definition at line 141 of file exif.php.

$Exif_meta_file = fopen($ExifDeviceMetadirFilename, 'w')

Definition at line 227 of file exif.php.

$Exif_str = ""

Definition at line 200 of file exif.php.

$ExifDeviceExifFilename = "/dev/exif_exif"

Definition at line 84 of file exif.php.

$ExifDeviceMetadirFilename = "/dev/exif_metadir"

Definition at line 83 of file exif.php.

$ExifDeviceMetaFilename = "/dev/exif_meta"

Definition at line 85 of file exif.php.

$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/>. ! -----------------------------------------------------------------------------** !

Log
exif.php,v
! Revision 1.1.1.1 2008/11/27 20:04:01 elphel ! ! ! Revision 1.2 2008/08/11 19:11:32 elphel ! comments ! ! Revision 1.1 2008/04/07 09:12:14 elphel ! New Exif template generation ! !
Log
exif.php,v
! Revision 1.1.1.1 2008/11/27 20:04:01 elphel ! ! ! Revision 1.2 2008/08/11 19:11:32 elphel ! comments ! ! Revision 1.1 2008/04/07 09:12:14 elphel ! New Exif template generation ! ! Revision 1.1.1.1 2007/10/03 19:05:53 elphel ! This is a fresh tree based on elphel353-2.10 ! ! Revision 1.6 2007/10/03 19:05:53 elphel ! cosmetic ! ! Revision 1.5 2007/10/03 18:37:53 elphel ! Made nice html output to see the result data ! ! Revision 1.4 2007/10/03 06:33:31 elphel ! fixed wrong copyright year ! ! Revision 1.3 2007/10/02 19:44:03 elphel ! minor bug fixes, added "manufacturer note" field for raw frame metadata (36 bytes - /include/asm-cris/c313.h frame_params_t) ! ! Revision 1.2 2007/09/25 23:34:02 elphel ! Fixed time strings to the right length ! ! Revision 1.1 2007/09/24 07:27:57 elphel ! Started php script that prepares Exif header information for serving images by imgsrv !

Definition at line 82 of file exif.php.

$ExifXMLName = "/etc/Exif_template.xml"

if called from the command line - accepts just one parameter - configuration file, through CGI - accepts more parameters

Definition at line 91 of file exif.php.

$frame_meta_size = 0

Definition at line 219 of file exif.php.

Referenced by test_print_directory().

$GPSInfo_offset = 12*count($xml_exif->Photo->children())+2+4+$SUB_IFD_offset

Definition at line 163 of file exif.php.

Referenced by process_ifd_entry(), and substitute_value().

$IFD_offset = count($exif_data)

Definition at line 161 of file exif.php.

$ifd_pointer = $SUB_IFD_offset

Definition at line 185 of file exif.php.

$ifd_pointer = $IFD_offset

Definition at line 179 of file exif.php.

Referenced by finish_ifd(), process_ifd_entry(), and start_ifd().

$init = true

Definition at line 96 of file exif.php.

$init = false

Definition at line 92 of file exif.php.

$metadir = fread ($Exif_file, 4096)

Definition at line 256 of file exif.php.

$nocompass = ($_GET["nocompass"]!==NULL)

Definition at line 98 of file exif.php.

$noGPS = ($_GET["noGPS"]!==NULL)

Definition at line 97 of file exif.php.

$SUB_IFD_offset = 12*count($xml_exif->Image->children())+2+4+$IFD_offset

Definition at line 162 of file exif.php.

Referenced by process_ifd_entry(), and substitute_value().

$xml_exif = simplexml_load_file($ExifXMLName)

Definition at line 147 of file exif.php.


Generated on Fri Nov 28 00:07:30 2008 for elphel by  doxygen 1.5.1