Udpated : Thumb Generation

This commit is contained in:
Arslan Hassan 2012-09-02 16:35:24 +00:00
parent 6a1ca78f45
commit d2587efbeb
3 changed files with 13 additions and 5 deletions

View file

@ -63,8 +63,8 @@ if ($process_running <= $max_processes && $queued_files) {
$log_file = $folder . '/' . $queue['queue_name'] . $vid_profile['suffix'] . '-' . $vid_profile['ext'] . '.log'; $log_file = $folder . '/' . $queue['queue_name'] . $vid_profile['suffix'] . '-' . $vid_profile['ext'] . '.log';
$fid = $cbupload->add_video_file($queue, array('noinfo'), 'p', $vid_profile['profile_id'], $log_file); $fid = $cbupload->add_video_file($queue, array('noinfo'), 'p', $vid_profile['profile_id'], $log_file);
$cbupload->update_queue_status($queue, 'u', 'Started conversion using Profile # ' . $vid_profile['profile_id'], true); $cbupload->update_queue_status($queue, 'u', 'Started conversion using Profile # ' . $vid_profile['profile_id'], true);
$log_file = LOGS_DIR . '/' . $log_file; $log_file = LOGS_DIR . '/' . $log_file;
@ -80,17 +80,22 @@ if ($process_running <= $max_processes && $queued_files) {
*/ */
if (!hasThumbs($queue)) { if (!hasThumbs($queue)) {
$cbupload->update_queue_status($queue, 'u', 'Generating thumbs...', false);
//Generate thumbnails first...then move on.. //Generate thumbnails first...then move on..
$thumb_sizes = get_thumb_sizes(); $thumb_sizes = get_thumb_sizes();
$thumbs_dir = THUMBS_DIR.'/'.$folder; $thumbs_dir = THUMBS_DIR.'/'.$folder;
if ($thumb_sizes) { if ($thumb_sizes) {
foreach ($thumb_sizes as $thumb_size) { foreach ($thumb_sizes as $thumb_size) {
$size = $thumb_size['size']; $size = $thumb_size['size'];
$suffix = $thumb_size['sufix']; $suffix = $thumb_size['suffix'];
$outname = $queue['queue_name'].'-'.$suffix; $outname = $queue['queue_name'].'-'.$suffix;
$cbupload->update_queue_status($queue, 'u', 'Extacting '.$outname, false);
//Using Multi Thumb Gen function.. //Using Multi Thumb Gen function..
//$converter = new CBConverter($original_source); //$converter = new CBConverter($original_source);
$converter->extractThumb(NULL, array( $converter->extractThumb(NULL, array(
@ -101,6 +106,8 @@ if ($process_running <= $max_processes && $queued_files) {
'outdir' => $thumbs_dir, 'outdir' => $thumbs_dir,
'resize' => 'fit' 'resize' => 'fit'
)); ));
} }
} }
} }

View file

@ -238,6 +238,7 @@ class CBConverter
} }
$result = shell_exec( $cmd.$output_cmd); $result = shell_exec( $cmd.$output_cmd);
if(!$result && $output) if(!$result && $output)
{ {
//Read output file.. //Read output file..
@ -1627,7 +1628,7 @@ class CBConverter
$CMD .= "' "; $CMD .= "' ";
} }
//echo $CMD .= " ".$outputname; echo $CMD .= " ".$outputname;
$this->exec($CMD); $this->exec($CMD);
return $CMD; return $CMD;

View file

@ -15,5 +15,5 @@ add_thumb_size('120x60');
add_thumb_size('160x120'); add_thumb_size('160x120');
add_thumb_size('300x250'); add_thumb_size('300x250');
add_thumb_size('640x360'); add_thumb_size('640x360');
add_thumb_size('same', 'original');
?> ?>