Index: /extensions/GDThumb/changelog.txt
===================================================================
--- /extensions/GDThumb/changelog.txt	(revision 30900)
+++ /extensions/GDThumb/changelog.txt	(revision 30901)
@@ -26,6 +26,11 @@
 
 === Changelog ===
+version 1.0.15
++ In Overlay Ex mode place "New Item" marker is placed in metadata area
++ Further and final improvement for file type markers in Overlay Ex mode. Now sensitive to file extensions. Supports image, video, music, pdf, doc, xls, ppt formats with associated markers.
+- Fixed issue when "big thumb" for video files become smaller than desired min size
+
 version 1.0.14
-+ Added integration with VideoJS plugin to allow display of "film" icon in square mode
++ Added integration with VideoJS plugin to allow display of "film" icon in Overlay Ex mode
 - Fixed issue with incorrect callback when "RV Thumb Scroller" plugin is used
 
Index: /extensions/GDThumb/css/gdthumb.css
===================================================================
--- /extensions/GDThumb/css/gdthumb.css	(revision 30900)
+++ /extensions/GDThumb/css/gdthumb.css	(revision 30901)
@@ -39,11 +39,10 @@
 ul.thumbnails .gdthumb .thumbLegend.overlay-ex .thumbTitle { position: absolute; left: 10px; right: 10px; top: 10px;font-size: 1.2em; text-transform: uppercase; }
 ul.thumbnails .gdthumb .thumbLegend.overlay-ex .thumbInfo  { position: absolute; bottom: 10px; left: 10px; right: 10px; padding-top: 6px; border-top: 1px solid #aaa; text-align: left; }
-ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .item-num  { background-color: #cc3333; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 4px; margin-right: 10px; font-size: 10px; text-align: center; }
-ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .hit-num   { background-color: #036FE5; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 4px; margin-right: 10px; font-size: 10px; text-align: center; }
+ul.thumbnails .gdthumb .thumbLegend.overlay-ex .thumbInfo span { display: inline-block; }
+ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .item-num  { background-color: #cc3333; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 5px; margin-right: 6px; font-size: 10px; text-align: center; }
+ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .hit-num   { background-color: #036FE5; min-width: 15px; height: 16px; display: block; color: #fff; float: left; line-height: 16px; padding: 1px; padding-top: 0px; padding-right: 4px; padding-left: 4px; margin-top: 4px; margin-right: 6px; font-size: 10px; text-align: center; }
 ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .rank-num  { float: right; margin-top: 2px; vertical-align: middle; height: 20px; line-height: 20px; }
 
-ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon-th-large { padding-top: 2px; font-size: 18px; }
-ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon-picture  { padding-top: 1px; font-size: 18px; }
-ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon-film     { padding-top: 3px; font-size: 18px; }
+ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon { padding-top: 3px; font-size: 17px; }
 
 ul.thumbnails.nowrap .gdthumb .thumbLegend { white-space: nowrap; overflow: hidden; height: auto; }
Index: /extensions/GDThumb/js/gdthumb.js
===================================================================
--- /extensions/GDThumb/js/gdthumb.js	(revision 30900)
+++ /extensions/GDThumb/js/gdthumb.js	(revision 30901)
@@ -48,5 +48,5 @@
   build: function () {
 
-    if ((GDThumb.method == 'square') && (GDThumb.big_thumb != null) && (GDThumb.big_thumb.height != GDThumb.big_thumb.width)) {
+    if ((GDThumb.method == 'square') && (GDThumb.big_thumb != null) && ((GDThumb.big_thumb.height != GDThumb.big_thumb.width) || (GDThumb.big_thumb.height < GDThumb.max_height))){
       var main_width = jQuery('ul.thumbnails').width();
       var max_col_count = Math.floor(main_width / GDThumb.max_height);
Index: /extensions/GDThumb/main.inc.php
===================================================================
--- /extensions/GDThumb/main.inc.php	(revision 30900)
+++ /extensions/GDThumb/main.inc.php	(revision 30901)
@@ -2,6 +2,6 @@
 /*
 Plugin Name: gdThumb
-Version: 1.0.14
-Description: Display thumbnails as patchwork
+Version: 1.0.15
+Description: Apply Masonry style to album or image thumbs
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=771
 Author: Serge Dosyukov 
@@ -19,5 +19,5 @@
 // | Plugin constants                                               |
 // +-----------------------------------------------------------------------+
-define('GDTHUMB_VERSION', '1.0.14');
+define('GDTHUMB_VERSION', '1.0.15');
 define('GDTHUMB_ID',      basename(dirname(__FILE__)));
 define('GDTHEME_PATH' ,   PHPWG_THEMES_PATH . 'greydragon/');
@@ -59,8 +59,43 @@
 function GDThumb_index() {
   global $template;
-  
+
+  $template->smarty->registerPlugin("function", "media_type", "GDThumb_media_type");
   $template->set_prefilter('index', 'GDThumb_prefilter');
 
   add_event_handler('loc_end_index_thumbnails', 'GDThumb_process_thumb', 50, 2);
+}
+                                                 
+function GDThumb_endsWith($needles, $haystack) {
+  if(empty($needles) || empty($haystack)):
+    return false;
+  else:
+    $arr_needles = explode(',', $needles);
+    
+    foreach ((array) $arr_needles as $needle) { 
+      if ((string) $needle === substr($haystack, -strlen($needle))) return true; 
+    } 
+    return false; 
+  endif;
+}
+
+function GDThumb_media_type($params, $smarty) {
+  if(empty($params["file"]))
+    return "image";
+
+  $file = $params["file"];
+  if (GDThumb_endsWith("webm,webmv,ogv,m4v,flv,mp4", $file))
+    return "video";
+  if (GDThumb_endsWith("mp3,ogg,oga,m4a,webma,fla,wav", $file))
+    return "music";
+  if (GDThumb_endsWith("pdf", $file))
+    return "pdf";
+  if (GDThumb_endsWith("doc,docx,odt", $file))
+    return "doc";
+  if (GDThumb_endsWith("xls,xlsx,ods", $file))
+    return "xls";
+  if (GDThumb_endsWith("ppt,pptx,odp", $file))
+    return "ppt";
+
+  return "image";
 }
 
Index: /extensions/GDThumb/template/gdthumb_cat.tpl
===================================================================
--- /extensions/GDThumb/template/gdthumb_cat.tpl	(revision 30900)
+++ /extensions/GDThumb/template/gdthumb_cat.tpl	(revision 30901)
@@ -15,13 +15,18 @@
       <span class="thumbName">
         <span class="thumbTitle">{$cat.NAME}
-        {if !empty($cat.icon_ts)}
-        <img title="{$cat.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png" alt="(!)">
+        {if $GDThumb.thumb_mode_album !== "overlay-ex"}
+          {if !empty($cat.icon_ts)}
+          <img title="{$cat.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png" alt="(!)">
+          {/if}
         {/if}
         </span>
         {if $GDThumb.thumb_mode_album == "overlay-ex"}
-          <span class="thumbInfo">
-            <span class="item-num">{$cat.count_images}</span>
-            <span class="glyphicon glyphicon-th-large grid-gallery-icon"></span>
-          </span>
+        <span class="thumbInfo">
+          <span class="item-num">{$cat.count_images}</span>
+          <span class="glyphicon glyphicon-th-large grid-gallery-icon"></span>
+          {if !empty($cat.icon_ts)}
+          <span class="new-thumb glyphicon glyphicon-asterisk" title="{$cat.icon_ts.TITLE}" alt="(!)"></span>
+          {/if}
+        </span>
         {elseif $GDThumb.thumb_metamode !== "hide"}
           {if isset($cat.INFO_DATES) }
Index: /extensions/GDThumb/template/gdthumb_thumb.tpl
===================================================================
--- /extensions/GDThumb/template/gdthumb_thumb.tpl	(revision 30900)
+++ /extensions/GDThumb/template/gdthumb_thumb.tpl	(revision 30901)
@@ -1,6 +1,10 @@
 {if !empty($thumbnails)}
-
+{*
+  {$thumbnails|print_r}
+*}
 {foreach from=$thumbnails item=thumbnail}
 {assign var=derivative value=$pwg->derivative($GDThumb_derivative_params, $thumbnail.src_image)}
+{assign var=media_type value={media_type file=$thumbnail.file}}
+
 <li class="gdthumb">
   {if $GDThumb.thumb_mode_photo !== "hide" }
@@ -20,12 +24,17 @@
       {/if}
     {/if}
+    {if $GDThumb.thumb_mode_album !== "overlay-ex"}
       {if !empty($thumbnail.icon_ts)}
       <img title="{$thumbnail.icon_ts.TITLE}" src="{$ROOT_URL}{$themeconf.icon_dir}/recent.png" alt="(!)">
       {/if}
+    {/if}
     </span>
     {if $GDThumb.thumb_mode_album == "overlay-ex"}
       <span class="thumbInfo">
         <span class="hit-num">{$thumbnail.hit}</span>
-        <span class="glyphicon {if $derivative->is_cached()}{if $derivative->get_url()|strstr:"/piwigo-videojs/"}glyphicon-film{else}glyphicon-picture{/if}{else}glyphicon-picture{/if}"></span>
+        <span class="glyphicon {if $media_type=="video"}glyphicon-film{elseif $media_type=="music"}glyphicon-music{elseif $media_type=="doc"}glyphicon-file{elseif $media_type=="pdf"}glyphicon-book{else}glyphicon-picture{/if}"></span>
+        {if !empty($thumbnail.icon_ts)}
+        <span class="new-thumb glyphicon glyphicon-asterisk" title="{$thumbnail.icon_ts.TITLE}" alt="(!)"></span>
+        {/if}
         {if $thumbnail.rating_score > 0}
         <span class="rank-num glyphicon glyphicon-star">{$thumbnail.rating_score|string_format:"%d"}</span>
