Ignore:
Timestamp:
Apr 5, 2011, 12:45:03 PM (13 years ago)
Author:
cljosse
Message:

[extensions] edit_gmaps compatibility with piwigo 2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/edit_gmaps/admin/include/EXIF.php

    r9412 r10060  
    118118function get_EXIF_JPEG( $filename )
    119119{
     120global $error_message ;
    120121        // Change: Added as of version 1.11
    121122        // Check if a wrapper is being used - these are not currently supported (see notes at top of file)
     
    123124        {
    124125                // A HTTP or FTP wrapper is being used - show a warning and abort
    125                 echo "HTTP and FTP wrappers are currently not supported with EXIF - See EXIF functionality documentation - a local file must be specified<br>";
    126                 echo "To work on an internet file, copy it locally to start with:<br><br>\n";
    127                 echo "\$newfilename = tempnam ( \$dir, \"tmpexif\" );<br>\n";
    128                 echo "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";
     126                $error_message .= "HTTP and FTP wrappers are currently not supported with EXIF - See EXIF functionality documentation - a local file must be specified<br>";
     127                $error_message .= "To work on an internet file, copy it locally to start with:<br><br>\n";
     128                $error_message .= "\$newfilename = tempnam ( \$dir, \"tmpexif\" );<br>\n";
     129                $error_message .= "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";
    129130                return FALSE;
    130131        }
     
    167168        {
    168169                // Could't open the file - exit
    169                 echo "<p>Could not open file $filename</p>\n";
     170                $error_message .= "<p>Could not open file $filename</p>\n";
    170171                return FALSE;
    171172        }
     
    296297function get_Meta_JPEG( $filename )
    297298{
     299global $error_message ;
    298300        // Change: Added as of version 1.11
    299301        // Check if a wrapper is being used - these are not currently supported (see notes at top of file)
     
    301303        {
    302304                // A HTTP or FTP wrapper is being used - show a warning and abort
    303                 echo "HTTP and FTP wrappers are currently not supported with Meta - See EXIF/Meta functionality documentation - a local file must be specified<br>";
    304                 echo "To work on an internet file, copy it locally to start with:<br><br>\n";
    305                 echo "\$newfilename = tempnam ( \$dir, \"tmpmeta\" );<br>\n";
    306                 echo "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";
     305                $error_message .= "HTTP and FTP wrappers are currently not supported with Meta - See EXIF/Meta functionality documentation - a local file must be specified<br>";
     306                $error_message .= "To work on an internet file, copy it locally to start with:<br><br>\n";
     307                $error_message .= "\$newfilename = tempnam ( \$dir, \"tmpmeta\" );<br>\n";
     308                $error_message .= "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";
    307309                return FALSE;
    308310        }
     
    345347        {
    346348                // Could't open the file - exit
    347                 echo "<p>Could not open file $filename</p>\n";
     349                $error_message .= "<p>Could not open file $filename</p>\n";
    348350                return FALSE;
    349351        }
     
    472474function get_EXIF_TIFF( $filename )
    473475{
     476global $error_message ;
    474477        // Change: Added as of version 1.11
    475478        // Check if a wrapper is being used - these are not currently supported (see notes at top of file)
     
    477480        {
    478481                // A HTTP or FTP wrapper is being used - show a warning and abort
    479                 echo "HTTP and FTP wrappers are currently not supported with TIFF - See EXIF/TIFF functionality documentation - a local file must be specified<br>";
    480                 echo "To work on an internet file, copy it locally to start with:<br><br>\n";
    481                 echo "\$newfilename = tempnam ( \$dir, \"tmptiff\" );<br>\n";
    482                 echo "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";
     482                $error_message .= "HTTP and FTP wrappers are currently not supported with TIFF - See EXIF/TIFF functionality documentation - a local file must be specified<br>";
     483                $error_message .= "To work on an internet file, copy it locally to start with:<br><br>\n";
     484                $error_message .= "\$newfilename = tempnam ( \$dir, \"tmptiff\" );<br>\n";
     485                $error_message .= "copy ( \"http://whatever.com\", \$newfilename );<br><br>\n";
    483486                return FALSE;
    484487        }
     
    491494        {
    492495                // Could't open the file - exit
    493                 echo "<p>Could not open file $filename</p>\n";
     496                $error_message .= "<p>Could not open file $filename</p>\n";
    494497                return FALSE;
    495498        }
     
    11281131function read_Multiple_IFDs( $filehnd, $Tiff_offset, $Byte_Align, $Tag_Definitions_Name, $local_offsets = FALSE, $read_next_ptr = TRUE )
    11291132{
     1133global $error_message ;
    11301134        // Start at the offset of the first IFD
    11311135        $Next_Offset = 0;
     
    11401144                {
    11411145                        // Error seeking to position of next IFD
    1142                         echo "<p>Error: Corrupted EXIF</p>\n";
     1146                        $error_message .= "<p>Error: Corrupted EXIF</p>\n";
    11431147                        return FALSE;
    11441148                }
     
    11891193function read_IFD_universal( $filehnd, $Tiff_offset, $Byte_Align, $Tag_Definitions_Name, $local_offsets = FALSE, $read_next_ptr = TRUE )
    11901194{
     1195global $error_message ;
     1196
    11911197        if ( ( $filehnd == NULL ) || ( feof( $filehnd ) ) )
    11921198        {
     
    12101216        {
    12111217                // Huge number of entries - abort
    1212                 echo "<p>Error: huge number of EXIF entries - EXIF is probably Corrupted</p>\n";
     1218                $error_message .= "<p>".$No_Entries."Error: huge number of EXIF entries - EXIF is probably Corrupted</p>\n";
    12131219
    12141220                return array ( FALSE , 0);
     
    12351241        {
    12361242                // Couldn't read the IFD Data properly, Some Casio files have no Next IFD pointer, hence cause this error
    1237                 echo "<p>Error: EXIF Corrupted</p>\n";
     1243                $error_message .= "<p>Error: EXIF Corrupted</p>\n";
    12381244                return array(FALSE, 0);
    12391245        }
     
    12911297                if ( $Data_Count > 100000 )
    12921298                {
    1293                      //   echo "<p>Error: huge EXIF data count - EXIF is probably Corrupted</p>\n";
     1299                     //   $error_message .= "<p>Error: huge EXIF data count - EXIF is probably Corrupted</p>\n";
    12941300
    12951301                        // Some Casio files have no Next IFD pointer, hence cause errors
     
    22022208******************************************************************************/
    22032209
    2204 function get_IFD_Data_Type( $input_data, $data_type, $Byte_Align )
    2205 {
     2210function get_IFD_Data_Type( $input_data, $data_type, $Byte_Align ){
     2211global $error_message ;
    22062212        // Check if this is a Unsigned Byte, Unsigned Short or Unsigned Long
    22072213        if (( $data_type == 1 ) || ( $data_type == 3 ) || ( $data_type == 4 ))
     
    22282234                // to return multiple values instead of a single value
    22292235
    2230                 echo "<p>Error - ASCII Strings should not be processed in get_IFD_Data_Type</p>\n";
     2236                $error_message .= "<p>Error - ASCII Strings should not be processed in get_IFD_Data_Type</p>\n";
    22312237                return "Error Should never get here"; //explode( "\x00", $input_data );
    22322238        }
Note: See TracChangeset for help on using the changeset viewer.