I've done that a lot of years ago in one of my private cpg1.5.x galleries. In function theme_display_thumbnails (copy it to your theme's theme.php file if it doesn't exist yet), I added
$type = cpg_get_type($thumb['filename']);
preg_match('/width="([0-9]+)" height="([0-9]+)"/', $thumb['image'], $matches);
$params['<span></span>'] = "<span class=\"thumbnail_type_{$type['content']} thumbnail_extension_{$type['extension']}\" style=\"width: {$matches[1]}px; height: {$matches[2]}px; \"></span>";
before
} else { // mode != 'thumb'
Additionally, you need to modify $template_thumbnail_view. Find
<a href="{LINK_TGT}">{THUMB}<br /></a>
and replace with
<div class="thumbnail_wrapper">
<a href="{LINK_TGT}">{THUMB}<span></span><br /></a>
</div>
or simply add the following to your theme's theme.php file, if $template_thumbnail_view doesn't exist yet.
$template_thumbnail_view = <<<EOT
<!-- BEGIN header -->
<tr>
<!-- END header -->
<!-- BEGIN thumb_cell -->
<td valign="top" class="thumbnails" width ="{CELL_WIDTH}" align="center">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<div class="thumbnail_wrapper">
<a href="{LINK_TGT}">{THUMB}<span></span><br /></a>
</div>
{CAPTION}
{ADMIN_MENU}
</td>
</tr>
</table>
</td>
<!-- END thumb_cell -->
<!-- BEGIN empty_cell -->
<td valign="top" class="thumbnails" align="center"> </td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
</tr>
<tr>
<!-- END row_separator -->
<!-- BEGIN footer -->
</tr>
<!-- END footer -->
<!-- BEGIN tabs -->
<tr>
<td colspan="{THUMB_COLS}" style="padding: 0px;">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
{TABS}
</tr>
</table>
</td>
</tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
<img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->
EOT;
Result looks like:
<span class="thumbnail_type_movie thumbnail_extension_youtube" style="width: 200px; height: 200px; "></span>
Corresponing css code seems to be:
.thumbnail_wrapper span.thumbnail_type_movie {
position:absolute;
top:3px;
left:3px;
opacity:0.7;
background:url(images/play-button.png) center center no-repeat;
}
Not sure if this works out of the box or if other modifications are needed.