diff options
author | http://kerravonsen.dreamwidth.org/ <http://kerravonsen.dreamwidth.org/@web> | 2013-12-18 01:04:17 -0400 |
---|---|---|
committer | admin <admin@branchable.com> | 2013-12-18 01:04:17 -0400 |
commit | 6f2420e9b8122e2e95385694a71a0ff53cdd050e (patch) | |
tree | 48da5667f732d7d9f9828c528b6c47f7212871c6 /doc/plugins/contrib | |
parent | 978688977ef3d6eef14cde992e86b0752aef09d4 (diff) | |
download | ikiwiki-6f2420e9b8122e2e95385694a71a0ff53cdd050e.tar ikiwiki-6f2420e9b8122e2e95385694a71a0ff53cdd050e.tar.gz |
fix for thumbnail size bug
Diffstat (limited to 'doc/plugins/contrib')
-rw-r--r-- | doc/plugins/contrib/album/discussion.mdwn | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index dad781808..3ad1d9541 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -476,3 +476,42 @@ My wishlist for the plugin would include: ---- +I've tracked down the "always showing the 96x96 thumbnails" bug! + +The problem is in the pagetemplate function, which calls "thumbnail" to determine the name of the thumbnail image to use. As you know, the "img" method of generating thumbnails includes the size of the thumbnail as part of its name (to ensure that resizing thumbnails will create a new file of the correct size). The problem is... that in the pagetemplate function, the thumbnailsize is NOT passed in to the call to "thumbnail", so it always returns the default size, 96x96. Hence nothing that anyone can do will change the thumbnails to anything else. Oh, the different-sized thumbnail images ARE created, but they're never linked to. + +Here's a context-diff of my fix: + +<pre> +*** /home/kat/files/repos/ikiwiki_smcv/IkiWiki/Plugin/album.pm 2013-12-18 14:50:06.861623226 +1100 +--- album.pm 2013-12-18 15:51:09.393582879 +1100 +*************** +*** 484,489 **** +--- 484,490 ---- + my $viewer = $params{page}; + my $album = $pagestate{$viewer}{album}{album}; + my $image = $pagestate{$viewer}{album}{image}; ++ my $thumbnailsize = $pagestate{$album}{album}{thumbnailsize}; + + return unless defined $album; + return unless defined $image; +*************** +*** 495,501 **** + + if ($template->query(name => 'thumbnail')) { + $template->param(thumbnail => +! thumbnail($viewer, $params{destpage})); + } + if (IkiWiki::isinlinableimage($image) + && ($template->query(name => 'imagewidth') || +--- 496,502 ---- + + if ($template->query(name => 'thumbnail')) { + $template->param(thumbnail => +! thumbnail($viewer, $params{destpage}, $thumbnailsize)); + } + if (IkiWiki::isinlinableimage($image) + && ($template->query(name => 'imagewidth') || +</pre> + +-- [[KathrynAndersen]] |