Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Bug] Custom thumbnail for non-image file  (Read 3109 times)

0 Members and 1 Guest are viewing this topic.

Bonelyfish

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
[Bug] Custom thumbnail for non-image file
« 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.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: [Bug] Custom thumbnail for non-image file
« Reply #1 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)

Logged

toppa

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: [Bug] Custom thumbnail for non-image file
« Reply #2 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:

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

Code: [Select]
$file_base_name = str_replace('.'.$mime_content['extension'],'',strtolower(basename($pic_row['filename'])));
or, if you have PHP5, change str_replace to str_ireplace()
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 15 queries.