⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iptc.php

📁 CMS系统 提供学习研究修改最好了 比流行的一些CMS简单 但是更容易理解 是帮助你学习PHPCMS系统的好东东哦
💻 PHP
📖 第 1 页 / 共 3 页
字号:
                        }
                        else
                        {
                                // Record is a recognised IPTC field - Process it accordingly

                                switch ( $IPTC_Record['IPTC_Type'] )
                                {
                                        case "1:00":    // Envelope Record:Model Version
                                        case "1:22":    // Envelope Record:File Format Version
                                                $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" . hexdec( bin2hex( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
                                                break;

                                        case "1:90":    // Envelope Record:Coded Character Set
                                                $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Decoding not yet implemented<br>\n (Hex Data: " . bin2hex( $IPTC_Record['RecData'] )  .")</td></tr>\n";
                                                break;
                                                // TODO: Implement decoding of IPTC record 1:90

                                        case "1:20":    // Envelope Record:File Format

                                                $formatno = hexdec( bin2hex( $IPTC_Record['RecData'] ) );

                                                // Lookup file format from lookup-table
                                                if ( array_key_exists( $formatno, $GLOBALS[ "IPTC_File Formats" ] ) )
                                                {
                                                        // Entry was found in lookup table - add it to HTML
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">File Format</td><td class=\"IPTC_Value_Cell\">". $GLOBALS[ "IPTC_File Formats" ][$formatno] . "</td></tr>\n";
                                                }
                                                else
                                                {
                                                        // No matching entry was found in lookup table - add message to html
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">File Format</td><td class=\"IPTC_Value_Cell\">Unknown File Format ($formatno)</td></tr>\n";
                                                }
                                                break;


                                        case "2:00":    // Application Record:Record Version
                                                $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">IPTC Version</td><td class=\"IPTC_Value_Cell\">" . hexdec( bin2hex( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
                                                break;

                                        case "2:42":    // Application Record: Action Advised

                                                // Looup Action
                                                if ( $IPTC_Record['RecData'] == "01" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Kill</td></tr>\n";
                                                }
                                                elseif ( $IPTC_Record['RecData'] == "02" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Replace</td></tr>\n";
                                                }
                                                elseif ( $IPTC_Record['RecData'] == "03" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Append</td></tr>\n";
                                                }
                                                elseif ( $IPTC_Record['RecData'] == "04" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Reference</td></tr>\n";
                                                }
                                                else
                                                {
                                                        // Unknown Action
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
                                                }
                                                break;

                                        case "2:08":    // Application Record:Editorial Update
                                                if ( $IPTC_Record['RecData'] == "01" )
                                                {
                                                        // Additional Language
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Additional language</td></tr>\n";
                                                }
                                                else
                                                {
                                                        // Unknown Value
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
                                                }
                                                break;

                                        case "2:30":    // Application Record:Release Date
                                        case "2:37":    // Application Record:Expiration Date
                                        case "2:47":    // Application Record:Reference Date
                                        case "2:55":    // Application Record:Date Created
                                        case "2:62":    // Application Record:Digital Creation Date
                                        case "1:70":    // Envelope Record:Date Sent
                                                $date_array = unpack( "a4Year/a2Month/A2Day", $IPTC_Record['RecData'] );
                                                $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" . nl2br( HTML_UTF8_Escape( $date_array['Day'] . "/" . $date_array['Month'] . "/" . $date_array['Year'] ) ) ."</td></tr>\n";
                                                break;

                                        case "2:35":    // Application Record:Release Time
                                        case "2:38":    // Application Record:Expiration Time
                                        case "2:60":    // Application Record:Time Created
                                        case "2:63":    // Application Record:Digital Creation Time
                                        case "1:80":    // Envelope Record:Time Sent
                                                $time_array = unpack( "a2Hour/a2Minute/A2Second/APlusMinus/A4Timezone", $IPTC_Record['RecData'] );
                                                $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" . nl2br( HTML_UTF8_Escape( $time_array['Hour'] . ":" . $time_array['Minute'] . ":" . $time_array['Second'] . " ". $time_array['PlusMinus'] . $time_array['Timezone'] ) ) ."</td></tr>\n";
                                                break;

                                        case "2:75":    // Application Record:Object Cycle
                                                // Lookup Value
                                                if ( $IPTC_Record['RecData'] == "a" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Morning</td></tr>\n";
                                                }
                                                elseif ( $IPTC_Record['RecData'] == "p" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Evening</td></tr>\n";
                                                }
                                                elseif ( $IPTC_Record['RecData'] == "b" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Both Morning and Evening</td></tr>\n";
                                                }
                                                else
                                                {
                                                        // Unknown Value
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
                                                }
                                                break;

                                        case "2:125":   // Application Record:Rasterised Caption
                                                $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">460x128 pixel black and white caption image</td></tr>\n";
                                                break;
                                                // TODO: Display Rasterised Caption for IPTC record 2:125

                                        case "2:130":   // Application Record:Image Type
                                                // Lookup Number of Components
                                                if ( $IPTC_Record['RecData']{0} == "0" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">No Objectdata";
                                                }
                                                elseif ( $IPTC_Record['RecData']{0} == "9" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Supplemental objects related to other objectdata";
                                                }
                                                else
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Number of Colour Components : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData']{0} ) );
                                                }

                                                // Lookup current objectdata colour
                                                if ( $GLOBALS['ImageType_Names'][ $IPTC_Record['RecData']{1} ] == "" )
                                                {
                                                        $output_str .= ", Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData']{1} ) );
                                                }
                                                else
                                                {
                                                        $output_str .= ", " . nl2br( HTML_UTF8_Escape( $GLOBALS['ImageType_Names'][ $IPTC_Record['RecData']{1} ] ) );
                                                }
                                                $output_str .= "</td></tr>\n";
                                                break;

                                        case "2:131":   // Application Record:Image Orientation
                                                // Lookup value
                                                if ( $IPTC_Record['RecData'] == "L" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Landscape</td></tr>\n";
                                                }
                                                elseif ( $IPTC_Record['RecData'] == "P" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Portrait</td></tr>\n";
                                                }
                                                elseif ( $IPTC_Record['RecData'] == "S" )
                                                {
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Square</td></tr>\n";
                                                }
                                                else
                                                {
                                                        // Unknown Orientation Value
                                                        $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
                                                }
                                                break;

                                        default:        // All other records
                                                $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" .nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
                                                break;
                                }
                        }
                }

                // Add Table End to HTML
                $output_str .= "</table><br>\n";
        }

        // Return HTML
        return $output_str;
}


/******************************************************************************
* End of Function:     Interpret_IPTC_to_HTML
******************************************************************************/



/******************************************************************************
* Global Variable:      IPTC_Entry_Names
*
* Contents:     The names of the IPTC-NAA IIM fields
*
******************************************************************************/

$GLOBALS[ "IPTC_Entry_Names" ] = array(
// Envelope Record
"1:00" => "Model Version",
"1:05" => "Destination",
"1:20" => "File Format",
"1:22" => "File Format Version",
"1:30" => "Service Identifier",
"1:40" => "Envelope Number",
"1:50" => "Product ID",
"1:60" => "Envelope Priority",
"1:70" => "Date Sent",
"1:80" => "Time Sent",
"1:90" => "Coded Character Set",
"1:100" => "UNO (Unique Name of Object)",
"1:120" => "ARM Identifier",
"1:122" => "ARM Version",

// Application Record

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -