コード例 #1
0
 $sync_arr['file'] = $filename;
 $exif = array();
 if ($sync_options['metadata']) {
     include "mediainfo.php";
 }
 //print_r($exif);
 if (isset($exif) and $sync_options['metadata']) {
     $exif = array_filter($exif);
     if (isset($exif['error'])) {
         $errors[] = $exif['error'];
     } else {
         if (!empty($exif) and count($exif) > 0) {
             $metadata++;
             isset($sync_options['batch_manager']) and $infos[] = $filename . ' metadata: ' . vjs_pprint_r($exif);
             //$infos[] = $filename. ' metadata: '.count($exif);
             $sync_arr['metadata'] = count($exif) . " " . vjs_pprint_r($exif);
             if ($sync_options['metadata'] and !$sync_options['simulate']) {
                 $dbfields = explode(",", "filesize,width,height,latitude,longitude,date_creation,rotation");
                 $query = "UPDATE " . IMAGES_TABLE . " SET " . vjs_dbSet($dbfields, $exif) . ", `date_metadata_update`=CURDATE() WHERE `id`=" . $row['id'] . ";";
                 //print $query;
                 pwg_query($query);
                 /* At some point we use our own table */
                 //$dbfields = explode(",", "format,type,duration,overall_bit_rate,model,make,display_aspect_ratio,width,height,frame_rate,channel,sampling_rate");
                 //$query = "UPDATE '".$prefixeTable."image_videojs' SET ".vjs_dbSet($dbfields, $exif).", `date_metadata_update`=CURDATE() WHERE `id`=".$row['id'].";";
                 //pwg_query($query);
             }
         }
     }
 }
 /* Create poster */
 if ($sync_options['poster']) {
コード例 #2
0
    check_pwg_token();
    vjs_begin_delete_elements(array($picture['id']));
    array_push($page['infos'], 'Thumbnails and Subtitle and extra videos source deleted');
}
$filename = $picture['path'];
// Get the metadata video information
include_once dirname(__FILE__) . '/../include/mediainfo.php';
if (isset($exif)) {
    $exif = array_filter($exif);
    if (isset($exif['error'])) {
        array_push($page['errors'], $exif['error']);
        unset($exif['error']);
    }
    // Import metadata into the DB
    if (isset($_GET['sync_metadata']) and $_GET['sync_metadata'] == 1 and !empty($exif) and count($exif) > 0) {
        array_push($page['infos'], ' metadata: ' . count($exif) . " " . vjs_pprint_r($exif));
        $dbfields = explode(",", "filesize,width,height,latitude,longitude,date_creation,rotation");
        $query = "UPDATE " . IMAGES_TABLE . " SET " . vjs_dbSet($dbfields, $exif) . ", `date_metadata_update`=CURDATE() WHERE `id`=" . $_GET['image_id'] . ";";
        pwg_query($query);
    }
    // replace some value by human readable string
    $exif['name'] = (string) $general->CompleteName;
    $exif['filename'] = (string) $general->FileName;
    $exif['filesize'] = (string) $general->FileSize_String;
    $exif['duration'] = (string) $general->Duration_String;
    $exif['bitrate'] = (string) $video->BitRate_String;
    $exif['sampling_rate'] = (string) $audio->SamplingRate_String;
    isset($exif['rotation']) and $exif['rotation'] = pwg_image::get_rotation_angle_from_code($exif['rotation']) . "°";
    ksort($exif);
}
// Try to guess the poster extension