예제 #1
0
    <body>

        <p >Interpreted using: <a href="http://www.ozhiker.com/electronics/pjmt/">PHP JPEG Metadata Toolkit version <?php 
echo $GLOBALS['Toolkit_Version'];
?>
, Copyright (C) 2004 Evan Hunter</a></p>                <!-- Change: displayed toolkit version numbers to reference Toolkit_Version.php - as of version 1.11 -->
        <br>

        <h2><B><U>Metadata for &quot;<?php 
echo $filename;
?>
&quot;</U></B></h2>


        <!-- Output the EXIF Information -->
        <?php 
echo Interpret_EXIF_to_HTML(get_EXIF_TIFF($filename), $filename);
?>

        <BR>
        <BR>
        <BR>
        <p>Interpreted using:</p>
        <p><a href="http://www.ozhiker.com/electronics/pjmt/" >PHP JPEG Metadata Toolkit version <?php 
echo $GLOBALS['Toolkit_Version'];
?>
, Copyright (C) 2004 Evan Hunter</a></p>              <!-- Change: displayed toolkit version numbers to reference Toolkit_Version.php - as of version 1.11 -->

    </body>

</html>
예제 #2
0
    while ($i < count($IRB_array) && $IRB_array[$i]['ResID'] != 0x409 && $IRB_array[$i]['ResID'] != 0x40c) {
        $i++;
    }
    // Check if a thumbnail was found
    if ($i < count($IRB_array)) {
        // A thumbnail was found, Display it
        ob_end_clean();
        header("Content-type: image/jpeg");
        print substr($IRB_array[$i]['ResData'], 28);
    }
} else {
    if (strcasecmp($path_parts["extension"], "tif") == 0 || strcasecmp($path_parts["extension"], "tiff") == 0) {
        // TIFF Extension
        include 'EXIF.php';
        // Retrieve the EXIF info
        $exif_array = get_EXIF_TIFF($filename);
        // Retrieve any Photoshop IRB data in the EXIF
        if (array_key_exists(0, $exif_array) && array_key_exists(34377, $exif_array[0]) && array_key_exists('Data', $exif_array[0][34377])) {
            $IRB_array = $exif_array[0][34377]['Data'];
            // Check if Photoshop IRB data was retrieved
            if ($IRB_array === FALSE) {
                // No Photoshop IRB data could be retrieved - abort
                ob_end_clean();
                echo "<p>Photoshop IRB could not be retrieved from the TIFF file</p>\n";
                return;
            }
            // Cycle through the resources in the Photoshop IRB
            // Until either a thumbnail resource is found or
            // there are no more resources
            $i = 0;
            while ($i < count($IRB_array) && $IRB_array[$i]['ResID'] != 0x409 && $IRB_array[$i]['ResID'] != 0x40c) {
 /**
  * match given array with exifdata from file
  * 
  * @param string imageFileName
  * @param array tagnameArray
  * @return array
  * @access public
  * @since 7/28/05
  */
 function extractExifMetadata($imageFileName)
 {
     $metadataArrays = array();
     $metadataArrays[] = get_EXIF_JPEG($imageFileName);
     $metadataArrays[] = get_Meta_JPEG($imageFileName);
     $metadataArrays[] = get_EXIF_TIFF($imageFileName);
     $results = array();
     foreach ($metadataArrays as $metadataArray) {
         if (is_array($metadataArray)) {
             $exifArray = $metadataArray[0]['34665']['Data'][0];
             if (is_array($exifArray)) {
                 foreach ($exifArray as $array) {
                     if ($array['Tag Name'] && $array['Text Value']) {
                         $results[$array['Tag Name']] = $array['Text Value'];
                     }
                 }
             }
         }
     }
     return $results;
 }