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: [Solved]: Changing thumbnails  (Read 6073 times)

0 Members and 1 Guest are viewing this topic.

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
[Solved]: Changing thumbnails
« on: July 10, 2004, 07:47:14 pm »

Hi,

Due to problems with my server I can't upload gif files. It was suggested to make gif files documents instead of images and this works. Only now I get a small picture saying FILE instead of a preview of the gif image. I know it's not possible to resize the images on my forum, but I would like to show the real image (only with width="150") on the main site of the forum. I already changed this for the intermediate pictures, but I don't know where to change this for the thumbnails. And I would like to do the same for movies (flash files). Maybe you can take a look at my forum and you will see what I'm talking about: www.sig-host.com.

Thanks for your help,

Snakeye
« Last Edit: July 15, 2004, 05:32:34 pm by GauGau »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Changing thumbnails
« Reply #1 on: July 10, 2004, 07:59:38 pm »

This thread talks about exactly what you want.
http://forum.coppermine-gallery.net/index.php?topic=7648.0
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #2 on: July 10, 2004, 08:50:17 pm »

What they do in that thread is to upload a second picture that is to be used as thumbnail. It's cool that  it's possible that way, but not really what I want. As I said my forum isn't able to make a thumbnail itself and I can't ask all my members to upload a second picture, especially since I'm not gonna give them access to the ftp. What I would like is that for documents (.gif files) and movies (.swf files) it shows the actual picture but only smaller (HTML: <img src="http:///....1.jpg "width="150"), so not a thumbnail. I did this for documents by changing the code in displayimage.php, but I can't find similar codes for thumbnails. You got any idea where to find this code?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Changing thumbnails
« Reply #3 on: July 11, 2004, 12:52:34 am »

what you request is simply not possible, as the two image libraries coppermine can use (ImageMagick and GD) both don't have support for animated gifs or flash files, so it's just wishfull thinking...

GauGau
Logged

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #4 on: July 11, 2004, 02:56:39 am »

^Well the GD on my board didn't support gif either, but I just edited the code a bit and new it shows the real image but only in a smaller width. And that's perfect for me. Since the gallery does actually show the flash and (animated) gif files (original sized versions) I was wondering how to display these full sized image where now the thumbnails are. That's all and that is possible of course. I just hoped you could tell me where your script shows the thumbnails. But thanks for your help anyway. You guys got a great gallery.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Changing thumbnails
« Reply #5 on: July 11, 2004, 02:47:08 pm »

Try in the theme.php;
Code: [Select]
function theme_display_thumbnails
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #6 on: July 11, 2004, 04:37:59 pm »

Thank you. I will have a look. You may close this topic now.
Logged

omniscientdeveloper

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 901
Re: Changing thumbnails
« Reply #7 on: July 11, 2004, 06:48:54 pm »

actually it should be get_pic_url in functions.inc.php


-omni
Logged

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #8 on: July 11, 2004, 08:43:21 pm »

^Thanks man. Indeed I need to edit the following:

Code: [Select]
// Use default thumbs
                if (is_null($filepathname)) {
                        // Check for default theme- and global-level thumbs
                        $thumb_paths[] = $THEME_DIR.'/images/';                 // Used for custom theme thumbs
                        $thumb_paths[] = 'images/';                             // Default Coppermine thumbs
                        foreach ($thumb_paths as $default_thumb_path) {
                                if (is_dir($default_thumb_path)) {
                                        foreach ($thumb_extensions as $extension) {
                                                // Check for extension-specific thumbs
                                                if (file_exists($default_thumb_path."thumb_{$mime_content['extension']}".$extension)) {
                                                        $filepathname =...................

Only I have to put the right part where the dots are now. You know what to put there to get the full sized image? Otherwise I will try to find out put there myself.
« Last Edit: July 12, 2004, 08:51:15 am by GauGau »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Changing thumbnails
« Reply #9 on: July 11, 2004, 08:44:12 pm »

OK,
Try this.  Go into config, and remove the prefix for thumbs.  This means the gallery shows the original pic, but at the thumb settings.

Don't know if this will work for your gif's, but it works for normal pics.  Not recommended for normal pics, as they take an age to load.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #10 on: July 11, 2004, 09:05:12 pm »

^It works even for animated gifs. I have gifs (and bmps) in the database as:
gif        image/gif     document
bmp     image/gif     document

I changed the thumb prefix and then it showed all the full images in the thumbnails. Now is it possible to only enable this for documents?

(I changed gif and bmp to document because of GD problems, I will not allow any other document types to be uploaded)
Logged

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #11 on: July 12, 2004, 12:30:55 am »

Ok it's almost solved now. Thanx to everyone for helping. I have posted the changes in the next post.

Edit: It's solved.
« Last Edit: July 12, 2004, 11:43:23 am by Snakeye »
Logged

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #12 on: July 12, 2004, 11:41:38 am »

Ok it's completely solved now. Now it will show the default thumbnail for all flash/movies and it will show the resized gif file if the full image is a gif. To look at it in action go to: www.sig-host.com.

This are the required changes:

Find:
Code: [Select]
$thumb_extensions = Array('.gif','.png','.jpg');
Add Below:
Code: [Select]
$thumbgif_extensions = Array('.gif');

Find:
Code: [Select]
$custom_thumb_path = $url_prefix[$pic_row['url_prefix']].$pic_row['filepath'].$pic_prefix[$mode];
Add Below:
Code: [Select]
$custom_path= $url_prefix[$pic_row['url_prefix']].$pic_row['filepath'];

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

Find:
Code: [Select]
               foreach ($thumb_extensions as $extension) {
                        if (file_exists($custom_thumb_path.$file_base_name.$extension)) {
                                $filepathname = $custom_thumb_path.$file_base_name.$extension;
                                break;
                        }
                }

Add Below:
Code: [Select]
foreach ($thumbgif_extensions as $extension) {
                       if (file_exists($custom_path.$file_base_name.".gif")) {
$filepathname = $custom_path.$filebig_base_name;
                                                        break;
                        }
}
Logged

Snakeye

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Changing thumbnails
« Reply #13 on: July 15, 2004, 12:50:17 pm »

You have to add "% ~" to Characters forbidden in filenames in the config menu to make sure files with such characters woon't give any problems.

This thread can now be closed, since it's solved.
Logged

BeerGuzler

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: [Solved]: Changing thumbnails
« Reply #14 on: November 26, 2004, 10:25:01 am »

Just a Quick note, could someone detail what files need the MODS??  ???


Php beginner learning the ropes ;D
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Changing thumbnails
« Reply #15 on: December 03, 2004, 04:43:34 pm »

Question:
Just a Quick note, could someone detail what files need the MODS?? ???

Answer:
actually it should be get_pic_url in functions.inc.php


-omni
(to be found in the "include" folder of your coppermine install).


 ;) Joachim
« Last Edit: December 03, 2004, 04:52:04 pm by GauGau »
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.