commit f18f1bcffd83dd989c6c7a998dba19278a8ff832
Author: Ryan Hughes <rjhughes@drawesome.localdomain>
Date:   Sat Aug 22 15:43:23 2009 -0400

    Thumbnailing works in postgres.

diff --git a/sites/all/modules/video/plugins/video_image/video_image.module b/sites/all/modules/video/plugins/video_image/video_image.module
index a152918..4cd59ee 100644
--- a/sites/all/modules/video/plugins/video_image/video_image.module
+++ b/sites/all/modules/video/plugins/video_image/video_image.module
@@ -468,8 +468,13 @@ function _video_image_temp_image_store(&$file) {
         $info = image_get_info($f);
         $file->fid = db_last_insert_id('files','fid');
         if($l=="_original"){
-            db_query("INSERT INTO {files} (fid, filename, filepath, filemime, filesize) VALUES (%d, '%s', '%s', '%s', '%s')",
-                $fid, "video_image_temp.$l", $f, $info['mime_type'], $info['file_size']);
+			if ($fid) {
+				db_query("INSERT INTO {files} (fid, filename, filepath, filemime, filesize) VALUES (%d, '%s', '%s', '%s', '%s')",
+					$fid, "video_image_temp.$l", $f, $info['mime_type'], $info['file_size']);
+			} else {
+				db_query("INSERT INTO {files} (filename, filepath, filemime, filesize) VALUES ('%s', '%s', '%s', '%s')",
+					"video_image_temp.$l", $f, $info['mime_type'], $info['file_size']);
+			}
         }
         $image->fids[$l] = $file->fid;
       }
