[Bug] Custom thumbnail for non-image file [Bug] Custom thumbnail for non-image file
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Bug] Custom thumbnail for non-image file

Started by Bonelyfish, February 01, 2005, 05:09:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bonelyfish

Spent an hour to make a custom thumbnail for an AVI movie following the doc. There is a catch not mentioned but may be some of you already know:

For non-image file uploaded the extension should be in lowercase or the custom thumbnail won't display.

Hope this will help.

Hein Traag

It is already mentioned in http://forum.coppermine-gallery.net/index.php?topic=10273.msg38683#msg38683

Although i agree the first post in that thread should be edited a little to make it more clear that it should be lower case (although all examples are already in lower case)


toppa

If you prefer to not always have to remember to lower-case the file extension, you can go into include/functions.inc.php and in the get_pic_url function, change the line:

$file_base_name = str_replace('.'.$mime_content['extension'],'',basename($pic_row['filename']));

to

$file_base_name = str_replace('.'.$mime_content['extension'],'',strtolower(basename($pic_row['filename'])));

or, if you have PHP5, change str_replace to str_ireplace()