Support » Plugins and Hacks » [Plugin: NextGEN Gallery] patch for reading XMP meta data

  • Resolved nadavkav


    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));

    $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 );
    return $xmp_data;

    return false;

  • The topic ‘[Plugin: NextGEN Gallery] patch for reading XMP meta data’ is closed to new replies.