Index: /branches/2.3/include/category_cats.inc.php
===================================================================
--- /branches/2.3/include/category_cats.inc.php	(revision 12544)
+++ /branches/2.3/include/category_cats.inc.php	(revision 12545)
@@ -177,9 +177,9 @@
 if (count($categories) > 0)
 {
-  $thumbnail_src_of = array();
+  $infos_of_image = array();
   $new_image_ids = array();
 
   $query = '
-SELECT id, path, tn_ext, level
+SELECT *
   FROM '.IMAGES_TABLE.'
   WHERE id IN ('.implode(',', $image_ids).')
@@ -190,5 +190,6 @@
     if ($row['level'] <= $user['level'])
     {
-      $thumbnail_src_of[$row['id']] = get_thumbnail_url($row);
+      $row['tn_src'] = get_thumbnail_url($row);
+      $infos_of_image[$row['id']] = $row;
     }
     else
@@ -229,5 +230,5 @@
   {
     $query = '
-SELECT id, path, tn_ext
+SELECT *
   FROM '.IMAGES_TABLE.'
   WHERE id IN ('.implode(',', $new_image_ids).')
@@ -236,5 +237,6 @@
     while ($row = pwg_db_fetch_assoc($result))
     {
-      $thumbnail_src_of[$row['id']] = get_thumbnail_url($row);
+      $row['tn_src'] = get_thumbnail_url($row);
+      $infos_of_image[$row['id']] = $row;
     }
   }
@@ -305,8 +307,10 @@
     }
 
+    $representative_infos = $infos_of_image[ $category['representative_picture_id'] ];
+
     $tpl_var =
         array(
           'ID'    => $category['id'],
-          'TN_SRC'   => $thumbnail_src_of[$category['representative_picture_id']],
+          'TN_SRC'   => $representative_infos['tn_src'],
           'TN_ALT'   => strip_tags($category['name']),
 
@@ -330,4 +334,21 @@
                 'subcatify_category_description')),
           'NAME'  => $name,
+          
+          // Extra fields for usage in extra themes
+          'FILE_PATH' => $representative_infos['path'],
+          'FILE_POSTED' => $representative_infos['date_available'],
+          'FILE_CREATED' => $representative_infos['date_creation'],
+          'FILE_DESC' => $representative_infos['comment'],
+          'FILE_AUTHOR' => $representative_infos['author'],
+          'FILE_HIT' => $representative_infos['hit'],
+          'FILE_SIZE' => $representative_infos['filesize'],
+          'FILE_WIDTH' => $representative_infos['width'],
+          'FILE_HEIGHT' => $representative_infos['height'],
+          'FILE_METADATE' => $representative_infos['date_metadata_update'],
+          'FILE_HAS_HD' => $representative_infos['has_high'],
+          'FILE_HD_WIDTH' => $representative_infos['high_width'],
+          'FILE_HD_HEIGHT' => $representative_infos['high_height'],
+          'FILE_HD_FILESIZE' => $representative_infos['high_filesize'],
+          'FILE_RATING_SCORE' => $representative_infos['rating_score'],
         );
     if ($conf['index_new_icon'])
Index: /branches/2.3/include/category_default.inc.php
===================================================================
--- /branches/2.3/include/category_default.inc.php	(revision 12544)
+++ /branches/2.3/include/category_default.inc.php	(revision 12545)
@@ -112,26 +112,29 @@
   $name = get_picture_title($row);
 
-  $tpl_var =
-    array(
-      'ID'        => $row['id'],
-      'TN_SRC'    => get_thumbnail_url($row),
-      'TN_ALT'    => htmlspecialchars(strip_tags($name)),
-      'TN_TITLE'  => get_thumbnail_title($row),
-      'URL'       => $url,
+  $tpl_var = array(
+    'ID' => $row['id'],
+    'TN_SRC' => get_thumbnail_url($row),
+    'TN_ALT' => htmlspecialchars(strip_tags($name)),
+    'TN_TITLE' => get_thumbnail_title($row),
+    'URL' => $url,
 
-   /* Fields for template-extension usage */
-      'FILE_PATH' => $row['path'],
-      'FILE_POSTED' => $row['date_available'],
-      'FILE_CREATED' => $row['date_creation'],
-      'FILE_DESC' => $row['comment'],
-      'FILE_AUTHOR' => $row['author'],
-      'FILE_HIT' => $row['hit'],
-      'FILE_SIZE' => $row['filesize'],
-      'FILE_WIDTH' => $row['width'],
-      'FILE_HEIGHT' => $row['height'],
-      'FILE_METADATE' => $row['date_metadata_update'],
-      'FILE_HAS_HD' => ($row['has_high'] and $user['enabled_high']=='true') ?
-                true:false, /* lack of include/functions_picture.inc.php */
+    // Extra fields for usage in extra themes
+    'FILE_PATH' => $row['path'],
+    'FILE_POSTED' => $row['date_available'],
+    'FILE_CREATED' => $row['date_creation'],
+    'FILE_DESC' => $row['comment'],
+    'FILE_AUTHOR' => $row['author'],
+    'FILE_HIT' => $row['hit'],
+    'FILE_SIZE' => $row['filesize'],
+    'FILE_WIDTH' => $row['width'],
+    'FILE_HEIGHT' => $row['height'],
+    'FILE_METADATE' => $row['date_metadata_update'],
+    'FILE_HAS_HD' => $row['has_high'],
+    'FILE_HD_WIDTH' => $row['high_width'],
+    'FILE_HD_HEIGHT' => $row['high_height'],
+    'FILE_HD_FILESIZE' => $row['high_filesize'],
+    'FILE_RATING_SCORE' => $row['rating_score'],
     );
+  
   if ($conf['index_new_icon'])
   {
