Better thumbnails hack - Page 2 Better thumbnails hack - 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

Better thumbnails hack

Started by Stramm, August 02, 2005, 06:56:36 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

willstein


tobyy

hi there! great hack!!

i had the problem that the album list view  thumb size was ignored and these thumbs had the same size as inside the gallery.

i checked my code and realized that the code in index.php has to be replaced 4 times, not only once:

Quote from: Stramm on August 02, 2005, 06:56:36 PM
find (4 times) in index.php
                        $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);

replace with
                        $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size'], "cat_thumb");


hopefully i'm right :)  maybe you should edit this in the mod-instructions..

cheers
t

Stramm

yes, that was a known bug.. read more about it and the complete fix here
http://forum.coppermine-gallery.net/index.php?topic=21469.msg102299#msg102299

I just have forgotten to post the fix here also.. thanks for mentioning

owenb

Nice one, Stramm. Got this working to my liking on my site now - www.owenbillcliffe.co.uk

However! I have put my own watermarks on photos before they are uploaded, and due to the size of the watermark, it is poking into the square thumbnail. It's not devastating, just a bit ugly. I wondered if there was an adjustment I could make to the code that creates the square that will create the square from one side or another on horizontal images, or one end or another on vertical ones, instead of just taking the central square.

That would mean that thumbnails would either contain my entire watermark, or none of it, which is preferable to me than all of them having just a bit.

Do you see what I mean? Is it possible?

Thanks man!
Owen

Stramm

have a look at picmgmnt.inc.php. In the function resize_image the crop values get calculated (for both ImageMagick[im] and GD[default]) after switch ($CONFIG['thumb_method'])

the value where to crop (center/left/right/top/bottom) is in $xOffset and $yOffset

owenb

Okeydokey, I had a look at where you pointed me to, and I was scared.

I'm afraid I couldn't even use logic and common sense to deduce what elements were doing what! Not that clever I'm afraid.

Is there a way to just MAKE them crop the horizontal ones (width greater than length) so that the left hand side of the thumb is the left hand side of the picture itself, and everything else crop the thumb from the centre?

Thank you in advance for taking the time to moderate these threads! :)

Owen

Stramm

what are you using?? ImageMagick or GD2.. I don't want to do extra work ;)

still.. you could use my watermark mod. Then you won't have watermarks on thumbs...

owenb

I'm using GD2.

And can you point me towards someone who is using your watermarks mod so I can see how it works? :) And is it tricky to add if you ALREADY have the better thumbs mod?

Cheers.
Owen

Stramm

http://forum.coppermine-gallery.net/index.php?topic=21469.0

read that. And I'm online right now so you should be able to check my sandbox CPG

owenb

Wow, that watermark hack looks like a LOT of hacking, and I'm still not sure how I have to alter it if I'm already using your square thumbs hack... which I am! :)

Stramm

Best is, if you don't use a lot of other mods, to install my mod pack.
If you don't want to use it.. no problem. Follow the instructions for the watermark mod and just use the picmgmnt.inc.php made for watermark and better thumbs hack (in that thread). I think it's even safe to use the one form the modpack. And that version is always up to date

owenb

I've got a fair amount of content hacking on my site, I think. No mods as such but elements chopped out, such as breadcrumbs, and certain graphical elements etc.

With your square thumbs hack already added, will just straight adding the watermark hack work?

I tried to add the whole shebang once before and I think it was too much for my puny brain to handle coz my entire site went t*ts up and I had to reinstall the duplicate I'd made... ;)

Stramm

should work.. at least the mods are made to work together like butter, hehehe
as you can see it on my site and in the mod pack thread ;) and maybe in the first post here (the picmgmnt.inc.php files for versions with and without watermark mod)

daniel_w

Will this hack be availiable for 1.4? I've had to change all thumbnails after upgrading.. :-(

Stramm

It's already finished.. needs still some testing though and will be only available within my modpack for 1.4 (I need to be more careful with new projects, maintainig these mods is time consuming)