[Plugin: NextGEN Gallery] patch for reading XMP meta data
-
here is a new version of the extract_XMP() function that reads the content of the image file (successfully). using the output buffer (ob_start() functions) was not successful on my server. not sure why?
function extract_XMP( $filename ) {
//TODO:Require a lot of memory, could be better
// ob_start();
// @readfile($filename);
// $source = ob_get_contents();
// ob_end_clean();$image_handle = fopen($filename, “r”);
$image_contents = fread($image_handle, filesize($filename));
fclose($image_handle);$start = strpos( $image_contents, “<x:xmpmeta” );
$end = strpos( $image_contents, “</x:xmpmeta>” );
if ((!$start === false) && (!$end === false)) {
$lenght = $end – $start;
$xmp_data = substr($image_contents, $start, $lenght+12 );
unset($image_contents);
return $xmp_data;
}unset($source);
return false;
}https://www.ads-software.com/extend/plugins/nextgen-gallery/
- The topic ‘[Plugin: NextGEN Gallery] patch for reading XMP meta data’ is closed to new replies.