Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - alekseyn1

Pages: 1 ... 3 4 5 6 [7]
91
Wow... this sounds crazy hard. I'm a little overwhelmed with all of the updates & corrections.

 Can we get a step by step for n00bs in one post?

OK guys... let's try again to put all code modifications in one place:

You should have mplayer.exe installed in "C:/mplayer/mplayer.exe" . You can download this application from here: http://www.mplayerhq.hu/design7/dload.html

Step 1.
In image_utils.php find and modify as follows:

Code: [Select]
function create_thumbnail($src, $dest, $quality, $dimension, $resize_type) {
  global $convert_options;

  if (file_exists($dest)) {
    @unlink($dest);
  }
  $image_info = (defined("IN_CP")) ? getimagesize($src) : @getimagesize($src);
  if (!$image_info) {
    return false;
  }
  $width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
  $resize_handle = "resize_image_".$convert_options['convert_tool'];
  if ($resize_handle($src, $dest, $quality, $width_height['width'], $width_height['height'], $image_info)) {
    @chmod($dest, CHMOD_FILES);
    return true;
  }
//****added from here****
  if (in_array(get_file_extension($new_name), array("mpg", "mpeg", "avi", "wmv")) && Generate_VideoThumb($src, $dest.".jpg")) {
    $new_thumb_name = $new_name.".jpg";
}
//****added to here****
  else {
    return false;
  }
}

//****added from here****
/**************************************************************************
 * WeZ - Get Vid Info Code                                                *
 *************************************************************************/
function movie_get_length_in_seconds($src)
{
$cmd = "C:\\mplayer\\mplayer.exe -identify -vo null -ao null -frames 1 \"".$src."\" 2>&1 | grep ID_LENGTH";
$output = exec($cmd);
list(,$length) = explode("=", $output);
$length = ceil($length/2);
return $length;
}


/**************************************************************************
 * WeZ - Get Thumb Code                                                *
 *************************************************************************/
function Generate_VideoThumb($src, $dest) {
  global $convert_options;
  $length = movie_get_length_in_seconds($src);
  $command = "C:\\mplayer\\mplayer.exe \"".$src."\" -ss ".$length." -nosound -vo jpeg:smooth=75 -vop scale=120:80 -frames 1 > imagegenoutput.txt";
  system($command);
  unlink("imagegenoutput.txt");
  rename("00000001.jpg",$dest);
  movie_get_length_in_seconds($src);
  return (file_exists($dest)) ? 1 : 0;
}
//****added to here****

Step2:
in member.php modify as follows:

Code: [Select]
// Upload thumb file
      $new_thumb_name = "";
      if (!empty($HTTP_POST_FILES['thumb_file']['tmp_name']) && $HTTP_POST_FILES['thumb_file']['tmp_name'] != "none" && !$uploaderror) {
        $new_thumb_name = $site_upload->upload_file("thumb_file", "thumb", $upload_cat, basename($new_name));
        if (!$new_thumb_name) {
          $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['thumb_upload_error'].": ".$new_thumb_name."</b><br />".$site_upload->get_upload_errors();
          @unlink(MEDIA_TEMP_PATH."/".$new_name);
          $uploaderror = 1;
        }
      }
      elseif (check_remote_thumb($remote_thumb_file)) {
        $new_thumb_name = $remote_thumb_file;
      }
      elseif ($config['auto_thumbnail'] == 1 && !empty($HTTP_POST_FILES['media_file'.$fileext]['tmp_name']) && $HTTP_POST_FILES['media_file'.$fileext]['tmp_name'] != "none" && !$uploaderror) {
        if ($direct_upload) {
          $src = MEDIA_PATH."/".$cat_id."/".$new_name;
          $dest = THUMB_PATH."/".$cat_id."/".$new_name;
        }
        else {
          $src = MEDIA_TEMP_PATH."/".$new_name;
          $dest = THUMB_TEMP_PATH."/".$new_name;
        }
        $do_create = 0;
        if ($image_info = @getimagesize($src)) {
          if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
            $do_create = 1;
          }
        }
        require_once(ROOT_PATH.'includes/image_utils.php');
        $convert_options = init_convert_options();
        if ($do_create) {
          if (!$convert_options['convert_error']) {
            $dimension = (intval($config['auto_thumbnail_dimension'])) ? intval($config['auto_thumbnail_dimension']) : 100;
            $resize_type = (intval($config['auto_thumbnail_resize_type'])) ? intval($config['auto_thumbnail_resize_type']) : 1;
            $quality = (intval($config['auto_thumbnail_quality']) && intval($config['auto_thumbnail_quality']) <= 100) ? intval($config['auto_thumbnail_quality']) : 100;

            if (create_thumbnail($src, $dest, $quality, $dimension, $resize_type)) {
              $new_thumb_name = $new_name;
            }
            }
          }
        else {
  if (in_array(get_file_extension($new_name), array("mpg", "mpeg", "avi", "wmv")) && Generate_VideoThumb($src, $dest.".jpg")) {
  $new_thumb_name = $new_name.".jpg";
}

        }
    }

And the final advise: If you want to try it then BACKUP YOUR ORIGINALS so you can always roll back the changes.  Hope I helped some of you guys! Good luck!

92
Hi son_gokou & alekseyn1,

Anyway, alekseyn1... i think i might be able to help you considering i also have that plug-in installed.

Thanks Wez! It helps a lot! At least this code now hels the thumbnailer.php to see that the thumb is missing... I will have to dig more in my code... mplayer.exe is not working properly for me...

Thanks anyways!

93
It would be nice that this mod was well organized in order to all people can easily install it :)


Guys, this mod is still not working propertly. If you still want to try it then follow the changes listed in post 21 of this thread. BUT BACKUP YOUR ORIGINALS so you can always roll back the changes.  Good luck!

94
this mod helps me a lot (i am still on 1.7 within runcms 1.5)! Thanks! I had trouble with video categories. Now it's much better! Thanks a lot again.

95
Discussion & Troubleshooting / Re: Problem with Paging line....
« on: January 19, 2007, 06:00:46 PM »
solved. this was a apache problem. reinstalled servers and problem disappeared.

96
Installation, Update & Configuration / Re: Sessions
« on: January 19, 2007, 05:59:24 PM »
problem solved.

There was a problem in my apache configuration. Although I am not sure where... Just reinstalled the servers....

97
Mods & Plugins (Releases & Support) / Re: [MOD] Auto-Thumbnailer v2.2.1
« on: January 18, 2007, 04:13:08 AM »
Hi everyone!
How do I make the thumbnailer.php (version 2.2.1) in CP see that the thumbs are missing?
This function does not see that mov,wmv,avi,mpg  files have no thumbs in Database....  I am using this code

http://www.4homepages.de/forum/index.php?topic=12272.15

Please help. I have a ton of videos with no preview that I want to add thumbs to but the thumbnailer does not check mov,wmv,avi,mpg files
Thanks,
Aleksey

98
Mods & Plugins (Requests & Discussions) / Re: Auto Thumbnailer
« on: January 18, 2007, 04:12:45 AM »
Hi everyone!
How do I make the thumbnailer.php (version 2.2.1) in CP see that the thumbs are missing?
This function does not see that mov,wmv,avi,mpg  files have no thumbs in Database....  I am using this code

http://www.4homepages.de/forum/index.php?topic=12272.15

Please help. I have a ton of videos with no preview that I want to add thumbs to but the thumbnailer does not check mov,wmv,avi,mpg files
Thanks,
Aleksey

99

And when I add a video from the "upload" button everything works just fine!!!

Autothumbnailer MOD 2.2.1 works great with pictures also.

Now here is the problem/request Autothumbnailer MOD 2.2.1 does not see that in 4images_images table the field image_thumb_file field is emply for everything that is not a picture (jpg). (all other autothumbnailers did not see other file types also)

How do I make the MOD see that there is no thumbnail for videos?

let me paraphrase my question:

How do I make this code work from thumbnailer.php (version 2.2.1) in CP? This function does not see that mov,wmv,avi files have no thumbs in Database.... Please help. I have a ton of videos with no preview that I want to add thumbs to...

100
Installation, Update & Configuration / Sessions
« on: January 11, 2007, 05:34:23 AM »
Hello everyone!

I have a question/request:  is it possible to turn off sessions in 4images, or maybe make them blank or something? Because I have a problem described here, and I can not resolve it (http://www.4homepages.de/forum/index.php?topic=15939.0)

Restoring original files from my mod download does not help ( I am running the gallery as a mod under e-xoops/runcms). So I figure it could be the conflict of sessions.

101
Discussion & Troubleshooting / Problem with Paging line....
« on: December 26, 2006, 06:55:35 AM »
Hi everybody...

I have a weird problem....

I am running my 1.7 gallery from within the e-xoops version (actually it's runcms 1.5) on the WinXP computer for the intranet purposes...

Now here is the problem.... in the course of work on the video thumbnals problem (http://www.4homepages.de/forum/index.php?topic=12272.msg85074#msg85074) i have ended up with the problem of links to pages in categories lead to the beginning on the Gallery...

For example:

When the user is logged off the line "1  2  3  4  5  »  last page" works just great and has "4images/categories.php?cat_id=45&sessionid=a:3:&page=5" etc... but when the user logs on... then the link is just "4images/" and the rest is missing....

Have no idea where to start digging....

102
Hello everyone!

I have been following the discussion regarding this issue and trying to modify the code myself.

Here is my result:

I am running of Gallery 1.7 (under runcms 1.5) on WinXP on the intranet.

first of all I had to increase the script timeout in php.ini to more than 30 seconds and memory allocation to more than 8 MB because I had timeout errors when adding 30 and more large images through the control panel (maybe this is irrelevant to the rest of the message, but paybe it will be helpful for some people)

I have modified the image_utils.php in an effort to make the system create the thumbnail from my videos (mostly avi, and wmv - have not tried it with mov yet):

image_utils.php
Code: [Select]
function create_thumbnail($src, $dest, $quality, $dimension, $resize_type) {
  global $convert_options;

  if (file_exists($dest)) {
    @unlink($dest);
  }
  $image_info = (defined("IN_CP")) ? getimagesize($src) : @getimagesize($src);
  if (!$image_info) {
    return false;
  }
  $width_height = get_width_height($dimension, $image_info[0], $image_info[1], $resize_type);
  $resize_handle = "resize_image_".$convert_options['convert_tool'];
  if ($resize_handle($src, $dest, $quality, $width_height['width'], $width_height['height'], $image_info)) {
    @chmod($dest, CHMOD_FILES);
    return true;
  }
//****added from here****
  if (in_array(get_file_extension($new_name), array("mpg", "mpeg", "avi", "wmv")) && Generate_VideoThumb($src, $dest.".jpg")) {
    $new_thumb_name = $new_name.".jpg";
}
//****added to here****
  else {
    return false;
  }
}

//****added from here****
function Generate_VideoThumb($src, $dest) {
  global $convert_options;
  $command = "C:\\mplayer\\mplayer.exe \"".$src."\" -ss 00:00:05 -nosound -vo jpeg:smooth=75 -vop scale=120:80 -frames 1 > imagegenoutput.txt";
  system($command);
  //unlink("00000001.jpg");
  unlink("imagegenoutput.txt");
  rename("00000001.jpg",$dest);
  return (file_exists($dest)) ? 1 : 0;
}
//****added to here****

and this is in my member.php
Code: [Select]
// Upload thumb file
      $new_thumb_name = "";
      if (!empty($HTTP_POST_FILES['thumb_file']['tmp_name']) && $HTTP_POST_FILES['thumb_file']['tmp_name'] != "none" && !$uploaderror) {
        $new_thumb_name = $site_upload->upload_file("thumb_file", "thumb", $upload_cat, basename($new_name));
        if (!$new_thumb_name) {
          $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['thumb_upload_error'].": ".$new_thumb_name."</b><br />".$site_upload->get_upload_errors();
          @unlink(MEDIA_TEMP_PATH."/".$new_name);
          $uploaderror = 1;
        }
      }
      elseif (check_remote_thumb($remote_thumb_file)) {
        $new_thumb_name = $remote_thumb_file;
      }
      elseif ($config['auto_thumbnail'] == 1 && !empty($HTTP_POST_FILES['media_file'.$fileext]['tmp_name']) && $HTTP_POST_FILES['media_file'.$fileext]['tmp_name'] != "none" && !$uploaderror) {
        if ($direct_upload) {
          $src = MEDIA_PATH."/".$cat_id."/".$new_name;
          $dest = THUMB_PATH."/".$cat_id."/".$new_name;
        }
        else {
          $src = MEDIA_TEMP_PATH."/".$new_name;
          $dest = THUMB_TEMP_PATH."/".$new_name;
        }
        $do_create = 0;
        if ($image_info = @getimagesize($src)) {
          if ($image_info[2] == 1 || $image_info[2] == 2 || $image_info[2] == 3) {
            $do_create = 1;
          }
        }
        require_once(ROOT_PATH.'includes/image_utils.php');
        $convert_options = init_convert_options();
        if ($do_create) {
          if (!$convert_options['convert_error']) {
            $dimension = (intval($config['auto_thumbnail_dimension'])) ? intval($config['auto_thumbnail_dimension']) : 100;
            $resize_type = (intval($config['auto_thumbnail_resize_type'])) ? intval($config['auto_thumbnail_resize_type']) : 1;
            $quality = (intval($config['auto_thumbnail_quality']) && intval($config['auto_thumbnail_quality']) <= 100) ? intval($config['auto_thumbnail_quality']) : 100;

            if (create_thumbnail($src, $dest, $quality, $dimension, $resize_type)) {
              $new_thumb_name = $new_name;
            }
            }
          }
        else {
  if (in_array(get_file_extension($new_name), array("mpg", "mpeg", "avi", "wmv")) && Generate_VideoThumb($src, $dest.".jpg")) {
  $new_thumb_name = $new_name.".jpg";
}

        }
    }

And when I add a video from the "upload" button everything works just fine!!!

Autothumbnailer MOD 2.2.1 works great with pictures also.

Now here is the problem/request Autothumbnailer MOD 2.2.1 does not see that in 4images_images table the field image_thumb_file field is emply for everything that is not a picture (jpg). (all other autothumbnailers did not see other file types also)

How do I make the MOD see that there is no thumbnail for videos?

Pages: 1 ... 3 4 5 6 [7]