forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: Snakeye on July 10, 2004, 07:47:14 pm

Title: [Solved]: Changing thumbnails
Post by: Snakeye 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
Title: Re: Changing thumbnails
Post by: Casper 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
Title: Re: Changing thumbnails
Post by: Snakeye 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?
Title: Re: Changing thumbnails
Post by: Joachim Müller 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
Title: Re: Changing thumbnails
Post by: Snakeye 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.
Title: Re: Changing thumbnails
Post by: Casper on July 11, 2004, 02:47:08 pm
Try in the theme.php;
Code: [Select]
function theme_display_thumbnails
Title: Re: Changing thumbnails
Post by: Snakeye on July 11, 2004, 04:37:59 pm
Thank you. I will have a look. You may close this topic now.
Title: Re: Changing thumbnails
Post by: omniscientdeveloper on July 11, 2004, 06:48:54 pm
actually it should be get_pic_url in functions.inc.php


-omni
Title: Re: Changing thumbnails
Post by: Snakeye 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.
Title: Re: Changing thumbnails
Post by: Casper 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.
Title: Re: Changing thumbnails
Post by: Snakeye 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)
Title: Re: Changing thumbnails
Post by: Snakeye 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.
Title: Re: Changing thumbnails
Post by: Snakeye 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;
                        }
}
Title: Re: Changing thumbnails
Post by: Snakeye 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.
Title: Re: [Solved]: Changing thumbnails
Post by: BeerGuzler 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
Title: Re: Changing thumbnails
Post by: Joachim Müller 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