[Solved]: Changing thumbnails [Solved]: Changing thumbnails
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: Changing thumbnails

Started by Snakeye, July 10, 2004, 07:47:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Snakeye

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

Casper

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

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?

Joachim Müller

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

Snakeye

^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.

Casper

Try in the theme.php;
function theme_display_thumbnails
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

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

omniscientdeveloper

actually it should be get_pic_url in functions.inc.php


-omni

Snakeye

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

// 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.

Casper

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.
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

^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)

Snakeye

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

Edit: It's solved.

Snakeye

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:
$thumb_extensions = Array('.gif','.png','.jpg');

Add Below:
$thumbgif_extensions = Array('.gif');


Find:
$custom_thumb_path = $url_prefix[$pic_row['url_prefix']].$pic_row['filepath'].$pic_prefix[$mode];

Add Below:
$custom_path= $url_prefix[$pic_row['url_prefix']].$pic_row['filepath'];


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

Add below:
$filebig_base_name = basename($pic_row['filename']);


Find:
               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:
foreach ($thumbgif_extensions as $extension) {
                       if (file_exists($custom_path.$file_base_name.".gif")) {
$filepathname = $custom_path.$filebig_base_name;
                                                       break;
                       }
}


Snakeye

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.

BeerGuzler

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


Php beginner learning the ropes ;D

Joachim Müller

#15
Question:
Quote from: BeerGuzler on November 26, 2004, 10:25:01 AM
Just a Quick note, could someone detail what files need the MODS?? ???

Answer:
Quote from: omniscientdeveloper on July 11, 2004, 06:48:54 PM
actually it should be get_pic_url in functions.inc.php


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


;) Joachim