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 [2]   Go Down

Author Topic: Better thumbnails hack  (Read 50568 times)

0 Members and 1 Guest are viewing this topic.

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: Better thumbnails hack
« Reply #20 on: October 28, 2005, 10:04:01 am »

thanks stramm
Logged

tobyy

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Better thumbnails hack
« Reply #21 on: November 10, 2005, 02:12:51 am »

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:

find (4 times) in index.php
Code: [Select]
                        $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
replace with
Code: [Select]
                        $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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Better thumbnails hack
« Reply #22 on: November 10, 2005, 12:09:06 pm »

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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Better thumbnails hack
« Reply #23 on: November 16, 2005, 09:33:50 pm »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Better thumbnails hack
« Reply #24 on: November 17, 2005, 08:42:37 am »

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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Better thumbnails hack
« Reply #25 on: November 18, 2005, 12:01:26 am »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Better thumbnails hack
« Reply #26 on: November 19, 2005, 09:39:12 am »

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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Better thumbnails hack
« Reply #27 on: November 19, 2005, 10:33:10 am »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Better thumbnails hack
« Reply #28 on: November 19, 2005, 10:38:37 am »

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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Better thumbnails hack
« Reply #29 on: November 19, 2005, 03:10:15 pm »

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! :)
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Better thumbnails hack
« Reply #30 on: November 19, 2005, 03:28:23 pm »

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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Better thumbnails hack
« Reply #31 on: November 19, 2005, 03:32:03 pm »

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... ;)
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Better thumbnails hack
« Reply #32 on: November 19, 2005, 03:43:00 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 10
Re: Better thumbnails hack
« Reply #33 on: November 27, 2005, 10:40:02 pm »

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Better thumbnails hack
« Reply #34 on: November 28, 2005, 08:44:20 am »

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)
Pages: 1 [2]   Go Up
 

Page created in 0.022 seconds with 19 queries.