Changeset 10060 for extensions/edit_gmaps/admin/include/EXIF.php
- Timestamp:
- Apr 5, 2011, 12:45:03 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/include/EXIF.php
r9412 r10060 118 118 function get_EXIF_JPEG( $filename ) 119 119 { 120 global $error_message ; 120 121 // Change: Added as of version 1.11 121 122 // Check if a wrapper is being used - these are not currently supported (see notes at top of file) … … 123 124 { 124 125 // 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"; 129 130 return FALSE; 130 131 } … … 167 168 { 168 169 // 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"; 170 171 return FALSE; 171 172 } … … 296 297 function get_Meta_JPEG( $filename ) 297 298 { 299 global $error_message ; 298 300 // Change: Added as of version 1.11 299 301 // Check if a wrapper is being used - these are not currently supported (see notes at top of file) … … 301 303 { 302 304 // 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"; 307 309 return FALSE; 308 310 } … … 345 347 { 346 348 // 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"; 348 350 return FALSE; 349 351 } … … 472 474 function get_EXIF_TIFF( $filename ) 473 475 { 476 global $error_message ; 474 477 // Change: Added as of version 1.11 475 478 // Check if a wrapper is being used - these are not currently supported (see notes at top of file) … … 477 480 { 478 481 // 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"; 483 486 return FALSE; 484 487 } … … 491 494 { 492 495 // 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"; 494 497 return FALSE; 495 498 } … … 1128 1131 function read_Multiple_IFDs( $filehnd, $Tiff_offset, $Byte_Align, $Tag_Definitions_Name, $local_offsets = FALSE, $read_next_ptr = TRUE ) 1129 1132 { 1133 global $error_message ; 1130 1134 // Start at the offset of the first IFD 1131 1135 $Next_Offset = 0; … … 1140 1144 { 1141 1145 // Error seeking to position of next IFD 1142 echo"<p>Error: Corrupted EXIF</p>\n";1146 $error_message .= "<p>Error: Corrupted EXIF</p>\n"; 1143 1147 return FALSE; 1144 1148 } … … 1189 1193 function read_IFD_universal( $filehnd, $Tiff_offset, $Byte_Align, $Tag_Definitions_Name, $local_offsets = FALSE, $read_next_ptr = TRUE ) 1190 1194 { 1195 global $error_message ; 1196 1191 1197 if ( ( $filehnd == NULL ) || ( feof( $filehnd ) ) ) 1192 1198 { … … 1210 1216 { 1211 1217 // 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"; 1213 1219 1214 1220 return array ( FALSE , 0); … … 1235 1241 { 1236 1242 // 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"; 1238 1244 return array(FALSE, 0); 1239 1245 } … … 1291 1297 if ( $Data_Count > 100000 ) 1292 1298 { 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"; 1294 1300 1295 1301 // Some Casio files have no Next IFD pointer, hence cause errors … … 2202 2208 ******************************************************************************/ 2203 2209 2204 function get_IFD_Data_Type( $input_data, $data_type, $Byte_Align ) 2205 { 2210 function get_IFD_Data_Type( $input_data, $data_type, $Byte_Align ){ 2211 global $error_message ; 2206 2212 // Check if this is a Unsigned Byte, Unsigned Short or Unsigned Long 2207 2213 if (( $data_type == 1 ) || ( $data_type == 3 ) || ( $data_type == 4 )) … … 2228 2234 // to return multiple values instead of a single value 2229 2235 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"; 2231 2237 return "Error Should never get here"; //explode( "\x00", $input_data ); 2232 2238 }
Note: See TracChangeset
for help on using the changeset viewer.