Custom Thumbnail for cpg1.5.x - Page 2 Custom Thumbnail for cpg1.5.x - Page 2
 

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

Custom Thumbnail for cpg1.5.x

Started by Αndré, June 22, 2009, 12:20:23 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

cl9m

ok sorry, I am wrong.
If I want watermark on thumbnails it's just differing picture thumb and movie thumb
I used watermark for put a icon movie on other file as picture.

(sorry for my english) :-\

Αndré

Quote from: cl9m on June 30, 2010, 03:13:00 PM
I used watermark for put a icon movie on other file as picture.
That's of course a feature request for this plugin.

If a user uploads a custom thumbnail for a movie we could add a film strip overlay to the thumb. I currently do this client-sided (before I upload that thumbnail). But we have to consider different video dimensions (4:3, 16:10, 16:9, etc.).

cl9m


cavok

I use Custom Thumbnail plugin as recommended with plugin Flash Media Player plugin with visual integration (play flv/mp4/mp3/aac files), but when I view the video page /coppermine/displayimage.php, after the video (when an automatic start) is the thumbnail that appears in large format.
So the quality is really bad. Can not we create an intermediate image of better quality?

Thank's
Coppermine 1.5.22 hosting by Free

Αndré

Open codebase.php, find
resize_image($thumb, $thumb, $CONFIG['thumb_width'], $CONFIG['thumb_method'], $CONFIG['thumb_use']);
and replace with
$resize_method = $CONFIG['picture_use'] == "thumb" ? ($CONFIG['thumb_use'] == "ex" ? "any" : $CONFIG['thumb_use']) : $CONFIG['picture_use'];
resize_image($thumb, $thumb, $CONFIG['picture_width'], $CONFIG['thumb_method'], $resize_method);

cavok

The image to replace the video in the page /coppermine/displayimage.php, at the end of the video
with this modification is of good quality now.

But unfortunately, now in the FilmStrip is a great image that appears, and is less well.
But perhaps this new problem is generated by other change Film strip - Overlap Thumbails
Coppermine 1.5.22 hosting by Free

Αndré

In that case you'll have to do more things.

I assume you're using unmodified versions of the both plugins.

First you have to modify the Custom Thumbnail plugin to create a thumbnail and an intermediate-sized image. Then you have to modify the Flash Media Player plugin to use the intermediate-sized image as preview image for the video.

Please give me some time and I'll release new packages of both plugins. I don't know if I find some time this weekend, but I think I'll solve it this year ;)

Αndré

Version 1.7 (attached to initial post) has a new option to create an additional intermediate-sized picture. It's now also compatible with the sef_url plugin.

cavok

Thank you, works perfectly with Flash Media Player plugin with a new option to create intermediate picture.
Coppermine 1.5.22 hosting by Free

shortmort37

Αndré,

I love this mod - it works great.

This was discussed in another thread, but - it would be really cool if, in addition to being able to assign a custom thumbnail to a video or file, you could also do so to a category.  e.g., I have a category for my Plymouth Gallery for the Sport Fury model, and categories underneath for individuals owning that model, with their albums under that.  I'd like to show a stylized thumbnail for the category, as in the attachment.

Perhaps if I knew how difficult that might be, I wouldn't even post the suggestion!  But I'm out of my depth in terms of doing it myself.  Just thought I'd ask!

Thanks
Dan

shortmort37

Quote from: shortmort37 on December 30, 2010, 03:47:32 PM
I'd like to show a stylized thumbnail for the category, as in the attachment.

Oops!  Sans attachment.  I also neglected to add:  I'd like for the thumbnail to not be constrainted to already be in any set underneath it.  With that constraint, it must also exist within an album that is exposed to all users, and I'd prefer not to create an album with category icons only.

Thanks
Dan

Αndré

shortmort37, that's not what this plugin was designed for. It's only a user-friendly interface for the already built-in mechanism of custom thumbnails. I don't know exactly what we discussed in the thread you mentioned, but I think what you tried to do isn't possible by default. Please start a new thread in the plugins board or in the feature requests board if you want to be able to do what you want to do in the future.


Templarart

Great plugin - exactly what I needed.  Here's a quick question/problem.  Do the dimensions of the new thumb have to stay the same as the dimensions of the old thumb?  I just tried replacing a tall, rectangular thumb with a square thumb and the square thumb was squished horizontally to the dimensions of the old thumb's tall rectangle.  Is this just unavoidable or am I doing something wrong?  Thanks.

Αndré

The thumbnail will always be resized to the values you specified in Coppermine's config. At least this is how the plugin should work by design.

Templarart

"The thumbnail will always be resized to the values you specified in Coppermine's config. At least this is how the plugin should work by design."

Right, that's a given - let's say 120 on the longest side.  What I'm wondering about is the proportions.  As I look at the thumbs in my gallery I see squares (120x120), long rectangles (120xwhatever) and tall rectangles (whateverx120).  I was trying to substitute a square (120x120) for a tall rectangle (70x120).  When I uploaded a square thumb (120x120), it was squished into the proportions of the original thumb (70x120).  If this is unavoidable... oh well, but I was hoping it was just a mistake I was making.

Thank you for your prompt reply.

Αndré

Please post a link to your gallery, especially to a thumbnail which doesn't have the correct size after you updated it with the plugin.

Alu

Is there a way to prevent it from converting it to .jpg if I upload .png?

Αndré

Quote from: Alu on April 18, 2011, 11:12:28 AM
Is there a way to prevent it from converting it to .jpg if I upload .png?

Open codebase.php, find
                if (!is_image($row['filename'])) {
                    $path_parts = pathinfo($row['filename']);
                    $row['filename'] = str_replace($row['filename'], basename($row['filename'], '.'.$path_parts['extension']).'.jpg', $row['filename']);
                }

and replace with
                if (!is_image($row['filename'])) {
                    $imginfo = cpg_getimagesize($fileupload['tmp_name']);
                    switch ($imginfo[2]) {
                        case '1': $extension = '.gif'; break;
                        case '3': $extension = '.png'; break;
                        default:  $extension = '.jpg'; break;
                    }
                    $path_parts = pathinfo($row['filename']);
                    $row['filename'] = str_replace($row['filename'], basename($row['filename'], '.'.$path_parts['extension']).$extension, $row['filename']);
                }


Note: it only works if you upload a custom thumbnail for non-images, as Coppermine assumes the same file type for images and their thumbnails. Additionally if you upload more than one custom thumbnail for the same file (with different extensions) more than one thumbnail for the same file may exists. In that case the standard routine of detecting custom thumbnails applies (GIF -> PNG -> JPG).

WillyWonderDog

Plugin works great. Thank you.  Of course I have a question though, what is the proper way to remove a custom thumbnail? I see how to change the custom thumbnail if desired by uploading a new image for it, but I can't figure out how to properly remove a custom thumbnail (and let it go back to the system thumbnail).