coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Upload => Topic started by: Bonelyfish on February 01, 2005, 05:09:03 PM

Title: [Bug] Custom thumbnail for non-image file
Post by: Bonelyfish on February 01, 2005, 05:09:03 PM
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.
Title: Re: [Bug] Custom thumbnail for non-image file
Post by: Hein Traag on February 01, 2005, 06:19:53 PM
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)

Title: Re: [Bug] Custom thumbnail for non-image file
Post by: toppa on March 14, 2005, 03:12:18 AM
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()