You are here

function _video_image_temp_image_store in Video 5

Same name and namespace in other branches
  1. 6 plugins/video_image/video_image.module \_video_image_temp_image_store()
  2. 6.2 plugins/video_image/video_image.module \_video_image_temp_image_store()
2 calls to _video_image_temp_image_store()
_video_image_prepare in plugins/video_image/video_image.module
_video_image_regenerate_thumbnail in plugins/video_image/video_image.module

File

plugins/video_image/video_image.module, line 356
Enable image support for video module.

Code

function _video_image_temp_image_store(&$file) {
  $image = new stdClass();
  $image->type = 'image';
  $image->uid = 1;
  $image->created = time();
  $image->title = t('video image thumbnail');
  image_prepare($image, $file);
  if ($image->images) {
    node_validate($image);
    if (!form_get_errors()) {

      // save the images in the files table
      foreach ($image->images as $l => $f) {
        $info = image_get_info($f);
        $fid = db_next_id('{files}_fid');
        db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', '%s')", $fid, 1, "video_image_temp.{$l}", $f, $info['mime_type'], $info['file_size']);
        $image->fids[$l] = $fid;
      }
    }
  }
  return (array) $image;
}