Index: /extensions/gvideo/admin/photo.php
===================================================================
--- /extensions/gvideo/admin/photo.php	(revision 17686)
+++ /extensions/gvideo/admin/photo.php	(revision 17687)
@@ -24,4 +24,6 @@
 if(!defined("PHPWG_ROOT_PATH")) die ("Hacking attempt!");
 
+include_once(GVIDEO_PATH.'include/functions.inc.php');
+
 
 // +-----------------------------------------------------------------------+
@@ -75,36 +77,43 @@
   if (count($page['errors']) == 0)
   {
-    include_once(GVIDEO_PATH.'include/functions.inc.php');
     include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
 
-    // download thumbnail
-    $thumb_name = $video['type'].'-'.$video['id'].'-'.uniqid().'.'.get_extension($video['thumbnail']);
-    $thumb_source = $conf['data_location'].$thumb_name;
-    if (download_remote_file($video['thumbnail'], $thumb_source) !== true)
-    {
-      $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg';
-      copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source);
-    }
-    
-    // add image and update infos
-    $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $_GET['image_id']);
-    
-    $updates = array(
-      'name' => pwg_db_real_escape_string($video['title']),
-      'comment' => pwg_db_real_escape_string($video['description']),
-      'author' => pwg_db_real_escape_string($video['author']),
-      'is_gvideo' => 1,
-      );
-    
-    single_update(
-      IMAGES_TABLE,
-      $updates,
-      array('id' => $_GET['image_id']),
-      true
-      );
+    if ( $gvideo['url'] != $video['url'] )
+    {
+      // download thumbnail
+      $thumb_name = $video['type'].'-'.$video['id'].'-'.uniqid().'.'.get_extension($video['thumbnail']);
+      $thumb_source = $conf['data_location'].$thumb_name;
+      if (download_remote_file($video['thumbnail'], $thumb_source) !== true)
+      {
+        $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg';
+        copy(GVIDEO_PATH.'mimetypes/'.$video['type'].'.jpg', $thumb_source);
+      }
+      
+      // add image and update infos
+      $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $_GET['image_id']);
+      
+      $updates = array(
+        'name' => pwg_db_real_escape_string($video['title']),
+        'comment' => pwg_db_real_escape_string($video['description']),
+        'author' => pwg_db_real_escape_string($video['author']),
+        'is_gvideo' => 1,
+        );
+      
+      single_update(
+        IMAGES_TABLE,
+        $updates,
+        array('id' => $_GET['image_id']),
+        true
+        );
+    }
     
     // register video
     if ($_POST['size_common'] == 'true')
     {
+      $_POST['width'] = $_POST['height'] = '';
+    }
+    else if ( !preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']) )
+    {
+      array_push($page['errors'], l10n('Width and height must be integers'));
       $_POST['width'] = $_POST['height'] = '';
     }
@@ -131,5 +140,5 @@
       
     array_push($page['infos'], l10n('Video successfully updated'));
-    unset($_POST);
+    $gvideo = array_merge($gvideo, $updates);
   }
 }
Index: /extensions/gvideo/admin/template/photo.tpl
===================================================================
--- /extensions/gvideo/admin/template/photo.tpl	(revision 17686)
+++ /extensions/gvideo/admin/template/photo.tpl	(revision 17687)
@@ -68,5 +68,5 @@
       <label><input type="radio" name="size_common" value="false" {if $GVIDEO.size_common != 'true'}checked="checked"{/if} data-toggle="size"> {'Change'|@translate}</label>
       
-      <span {if $GVIDEO.size_common == 'true'}style="display:none;"{/if} id="size">
+      <span style="display:{if $GVIDEO.size_common == 'true'}none{else}block{/if};" id="size">
         <input type="text" name="width" value="{$GVIDEO.width}" size="4"> &times;
         <input type="text" name="height" value="{$GVIDEO.height}" size="4"> px
@@ -79,5 +79,5 @@
       <label><input type="radio" name="autoplay_common" value="false" {if $GVIDEO.autoplay_common != 'true'}checked="checked"{/if} data-toggle="autoplay"> {'Change'|@translate}</label>
       
-      <span {if $GVIDEO.autoplay_common == 'true'}style="display:none;"{/if} id="autoplay">
+      <span style="display:{if $GVIDEO.autoplay_common == 'true'}none{else}block{/if};" id="autoplay">
         <label><input type="radio" name="autoplay" value="0" {if $GVIDEO.autoplay == '0'}checked="checked"{/if}> {'No'|@translate}</label>
         <label><input type="radio" name="autoplay" value="1" {if $GVIDEO.autoplay == '1'}checked="checked"{/if}> {'Yes'|@translate}</label>
