]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/contrib/album/discussion.mdwn
4db06d853011c87b7dca7fbb818bba64823d7fff
[ikiwiki.git] / doc / plugins / contrib / album / discussion.mdwn
1 thanks for this plugin.  it might help me in my application, which is to provide album/galleries which can be edited (ie. new images added, taken away, etc.) through web interface.
2
3 > That's my goal eventually, too. Perhaps you can help to
4 > design/write this plugin? At the moment I'm mostly
5 > waiting for a design "sanity check" from [[Joey]],
6 > but any feedback you can provide on the design would
7 > also be helpful. --[[smcv]]
8
9 i have two challenges: firstly, for installation, i'm not sure what all the files are that need to be downloaded (because of my setup i can't easily pull the repo).  so far i have Ikiwiki/Plugins/album.pm; ikiwiki-album; and 4 files in templates/  any others?
10
11 > Those are all the added files; ikiwiki-album isn't strictly
12 > needed (IkiWiki itself doesn't use that code, but you can
13 > use it to turn a directory full of images into correct
14 > input for the album plugin).
15 >
16 > You probably also want the album plugin's expanded version of
17 > style.css (or put its extra rules in your local.css).
18 > Without that, your albums will be quite ugly.
19 >
20 > There aren't currently any other files modified by my branch.
21 > --[[smcv]]
22
23 secondly: barring the CGI interface for editing the album, which would be great, is there at least a way to use attachment plugin or any other to manually add images and then create viewers for them?
24
25 > Images are just attachments, and viewers are pages (any supported
26 > format, but .html will be fastest to render). Attach each image,
27 > then write a page for each image containing the
28 > \[[!albumimage]] directive (usually it will *only* contain that
29 > directive).
30 >
31 > The script ikiwiki-album can help you to do this in a git/svn/etc.
32 > tree; doing it over the web will be a lot of work (until I get
33 > the CGI interface written), but it should already be possible!
34 >
35 > The structure is something like this:
36
37 > * album.mdwn (contains the \[[!album]] directive, and perhaps also
38 >   some \[[!albumsection]] directives)
39 > * album/a.jpg
40 > * album/a.html (contains the \[[!albumimage]] directive for a.jpg)
41 > * album/b.jpg
42 > * album/b.html (contains the \[[!albumimage]] directive for b.jpg)
43 >
44 > Have a look at ikiwiki-album to see how the directives are meant to
45 > work in practice.
46 >
47 > --[[smcv]]
48
49 >> In the current version of the branch, the viewer pages are
50 >> generated automatically if you didn't generate them yourself,
51 >> so `ikiwiki-album` is no longer needed. --[[smcv]]
52
53 i'm new to ikiwiki, apologies if this is dealt with elsewhere.  -brush
54
55 > This plugin is pretty ambitious, and is unfinished, so I'd recommend
56 > playing with  a normal IkiWiki installation for a bit, then trying
57 > out this plugin when you've mastered the basics of IkiWiki. --[[smcv]]
58
59 ----
60
61 ## design feedback from joeyh on an earlier version
62
63 You had wanted my feedback on the design of this. I have not looked at the
64 code or tried it yet, but here goes. --[[Joey]] 
65
66 * Needing to create the albumimage "viewer" pages for each photo
67   seems like it will become a pain. Everyone will need to come up
68   with their own automation for it, and then there's the question
69   of how to automate it when uploading attachments. -J
70
71 > There's already a script (ikiwiki-album) to populate a git
72 > checkout with skeleton "viewer" pages; I was planning to make a
73 > specialized CGI interface for albums after getting feedback from
74 > you (since the requirements for that CGI interface change depending
75 > on the implementation). I agree that this is ugly, though. -s
76
77 >> Would you accept a version where the albumimage "viewer" pages
78 >> could be 0 bytes long, at least until metadata gets added?
79 >>
80 >> The more I think about the "binaries as first-class pages" approach,
81 >> the more subtle interactions I notice with other plugins. I
82 >> think I'm up to needing changes to editpage, comments, attachment
83 >> and recentchanges, plus adjustments to img and Render (to reduce
84 >> duplication when thumbnailing an image with a strange extension
85 >> while simultaneously changing the extension, and to hardlink/copy
86 >> an image with a strange extension to a differing target filename
87 >> with the normal extension, respectively). -s
88
89 >>> Now that we have `add_autofile` I can just create viewer pages
90 >>> whenever there's an image to view. The current version of the
91 >>> branch does that. -s
92
93 * With each viewer page having next/prev links, I can see how you
94   were having the scalability issues with ikiwiki's data structures
95   earlier! -J
96
97 > Yeah, I think they're a basic requirement from a UI point of view
98 > though (although they don't necessarily have to be full wikilinks).
99 > -s
100
101 >> I think that with the new dependency types system, the dependencies for
102 >> these can be presence dependencies, which will probably help with
103 >> avoiding rebuilds of a page if the next/prev page is changed.
104 >> (Unless you use img to make the thumbnails for those links, then it
105 >> would rebuild the thumbnails anyway. Have not looked at the code.) --[[Joey]]
106
107 >>> I do use img. -s
108
109 * And doesn't each viewer page really depend on every other page in the
110   same albumsection? If a new page is added, the next/prev links
111   may need to be updated, for example. If so, there will be much
112   unnecessary rebuilding. -J
113
114 > albumsections are just a way to insert headings into the flow of
115 > photos, so they don't actually affect dependencies.
116 >
117 > One non-obvious constraint of ikiwiki's current design is that
118 > everything "off-page" necessary to build any page has to happen
119 > at scan time, which has caused a few strange design decisions,
120 > like the fact that each viewer controls what album it's in.
121 >
122 > It's difficult for the contents of the album to just be a
123 > pagespec, like for inline, because pagespecs can depend on
124 > metadata, which is gathered in arbitrary order at scan time;
125 > so the earliest you can safely apply a pagespec to the wiki
126 > contents to get a concrete list of pages is at rebuild time.
127 >
128 > (This stalled my attempt at a trail plugin, too.) -s
129
130 >> Not sure I understand why these need to look at pagespecs at scan time?
131 >> Also, note that it is fairly doable to detect if a pagespec uses such
132 >> metadata. Er, I mean, I have a cheezy hack in `add_depends` now that does
133 >> it to deal with a similar case. --[[Joey]] 
134
135 >>> I think I was misunderstanding how early you have to call `add_depends`?
136 >>> The critical thing I missed was that if you're scanning a page, you're
137 >>> going to rebuild it in a moment anyway, so it doesn't matter if you
138 >>> have no idea what it depends on until the rebuild phase. -s
139
140 * One thing I do like about having individual pages per image is
141   that they can each have their own comments, etc. -J
142
143 > Yes; also, they can be wikilinked. I consider those to be
144 > UI requirements. -s
145
146 * Seems possibly backwards that the albumimage controls what album
147   an image appears in. Two use cases -- 1: I may want to make a locked
148   album, but then anyone who can write to any other page on the wiki can
149   add an image to it. 2: I may want an image to appear in more than one
150   album. Think tags. So it seems it would be better to have the album
151   directive control what pages it includes (a la inline). -J
152
153 > I'm inclined to fix this by constraining images to be subpages of exactly
154 > one album: if they're subpages of 2+ nested albums then they're only
155 > considered to be in the deepest-nested one (i.e. longest URL), and if
156 > they're not in any album then that's a usage error. This would
157 > also make prev/next links sane. -s
158
159 >> The current version constrains images to be in at most one album,
160 >> choosing one arbitrarily (dependent on scan order) if albums are
161 >> nested. -s
162
163 > If you want to reference images from elsewhere in the wiki and display
164 > them as if in an album, then you can use an ordinary inline with
165 > the same template that the album would use, and I'll make sure the
166 > templates are set up so this works. -s
167
168 >> Still needs documenting, I've put it on the TODO list on the main
169 >> page. -s
170
171 > (Implementation detail: this means that an image X/Y/Z/W/V, where X and
172 > Y are albums, Z does not exist and W exists but is not an album,
173 > would have a content dependency on Y, a presence dependency on Z
174 > and a content dependency on W.)
175 >
176 > Perhaps I should just restrict to having the album images be direct
177 > subpages of the album, although that would mean breaking some URLs
178 > on the existing website I'm doing all this work for... -s
179
180 >> The current version of the branch doesn't have this restriction;
181 >> perhaps it's a worthwhile simplification, or perhaps it's too
182 >> restrictive? I fairly often use directory hierarchies like
183 >> `a_festival/saturday/foo.jpg` within an album, which makes
184 >> it very easy to write `albumsection` filters. -s
185
186 * Putting a few of the above thoughts together, my ideal album system
187   seems to be one where I can just drop the images into a directory and
188   have them appear in the album index, as well as each generate their own wiki
189   page. Plus some way I can, later, edit metadata for captions,
190   etc. (Real pity we can't just put arbitrary metadata into the images
191   themselves.) This is almost pointing toward making the images first-class
192   wiki page sources. Hey, it worked for po! :) But the metadata and editing
193   problems probably don't really allow that. -J
194
195 > Putting a JPEG in the web form is not an option from my point of
196 > view :-) but perhaps there could just be a "web-editable" flag supplied
197 > by plugins, and things could be changed to respect it.
198
199 >> Replying to myself: would you accept patches to support
200 >> `hook(type => 'htmlize', editable => 0, ...)` in editpage? This would
201 >> essentially mean "this is an opaque binary: you can delete it
202 >> or rename it, and it might have its own special editing UI, but you
203 >> can never get it in a web form".
204 >>
205 >> On the other hand, that essentially means we need to reimplement
206 >> editpage in order to edit the sidecar files that contain the metadata.
207 >> Having already done one partial reimplementation of editpage (for
208 >> comments) I'm in no hurry to do another.
209 >>
210 >> I suppose another possibility would be to register hook
211 >> functions to be called by editpage when it loads and saves the
212 >> file. In this case, the loading hook would be to discard
213 >> the binary and use filter() instead, and the saving conversion
214 >> would be to write the edited content into the metadata sidecar
215 >> (creating it if necessary).
216 >>
217 >> I'd also need to make editpage (and also comments!) not allow the
218 >> creation of a file of type albumjpg, albumgif etc., which is something
219 >> I previously missed; and I'd need to make attachment able to
220 >> upload-and-rename.
221 >> -s
222
223 >>> I believe the current branch meets your requirements, by having
224 >>> first-class wiki pages spring into existence using `add_autofile`
225 >>> to be viewer pages for photos. -s
226
227 > In a way, what you really want for metadata is to have it in the album
228 > page, so you can batch-edit the whole lot by editing one file (this
229 > does mean that editing the album necessarily causes each of its viewers
230 > to be rebuilt, but in practice that happens anyway). -s
231
232 >> Replying to myself: in practice that *doesn't* happen anyway. Having
233 >> the metadata in the album page is somewhat harmful because it means
234 >> that changing the title of one image causes every viewer in the album
235 >> to be rebuilt, whereas if you have a metadata file per image, only
236 >> the album itself, plus the next and previous viewers, need
237 >> rebuilding. So, I think a file per image is the way to go.
238 >>
239 >> Ideally we'd have some way to "batch-edit" the metadata of all
240 >> images in an album at once, except that would make conflict
241 >> resolution much more complicated to deal with; maybe just
242 >> give up and scream about mid-air collisions in that case?
243 >> (That's apparently good enough for Bugzilla, but not really
244 >> for ikiwiki). -s
245
246 >>> This is now in the main page's TODO list; if/when I implement this,
247 >>> I intend to make it a specialized CGI interface. -s
248
249 >> Yes, [all metadata in one file] would make some sense.. It also allows putting one image in
250 >> two albums, with different caption etc. (Maybe for different audiences.)
251 >> --[[Joey]]
252
253 >>> Eek. No, that's not what I had in mind at all; the metadata ends up
254 >>> in the "viewer" page, so it's necessarily the same for all albums. -s
255
256 >> It would probably be possible to add a new dependency type, and thus
257 >> make ikiwiki smart about noticing whether the metadata has actually
258 >> changed, and only update those viewers where it has. But the dependency
259 >> type stuff is still very new, and not plugin friendly .. so only just
260 >> possible, --[[Joey]] 
261
262 ----
263
264 ## alternative "special extension" design (conclusion: "don't")
265
266 '''I think the "special extension" design is a dead-end, but here's what
267 happened when I tried to work out how it would work. --[[smcv]]'''
268
269 Suppose that each viewer is a JPEG-or-GIF-or-something, with extension
270 ".albumimage". We have a gallery "memes" with three images, badger,
271 mushroom and snake.
272
273 > An alternative might be to use ".album.jpg", and ".album.gif"
274 > etc as the htmlize extensions. May need some fixes to ikiwiki to support
275 > that. --[[Joey]] 
276
277 >> foo.albumjpg (etc.) for images, and foo._albummeta (with
278 >> `keepextension => 1`) for sidecar metadata files, seems viable. -s
279
280 Files in git repo:
281
282 * index.mdwn
283 * memes.mdwn
284 * memes/badger.albumjpg (a renamed JPEG)
285 * memes/badger/comment_1._comment
286 * memes/badger/comment_2._comment
287 * memes/mushroom.albumgif (a renamed GIF)
288 * memes/mushroom._albummeta (sidecar file with metadata)
289 * memes/snake.albummov (a renamed video)
290
291 Files in web content:
292
293 * index.html
294 * memes/index.html
295 * memes/96x96-badger.jpg (from img)
296 * memes/96x96-mushroom.gif (from img)
297 * memes/96x96-snake.jpg (from img, hacked up to use totem-video-thumbnailer :-) )
298 * memes/badger/index.html (including comments)
299 * memes/badger.jpg
300 * memes/mushroom/index.html
301 * memes/mushroom.gif
302 * memes/snake/index.html
303 * memes/snake.mov
304
305 ispage("memes/badger") (etc.) must be true, to make the above rendering
306 happen, so albumimage needs to be a "page" extension.
307
308 To not confuse other plugins, album should probably have a filter() hook
309 that turns .albumimage files into HTML? That'd probably be a reasonable
310 way to get them rendered anyway.
311
312 > I guess that is needed to avoid preprocess, scan, etc trying to process
313 > the image, as well as eg, smiley trying to munge it in sanitize.
314 > --[[Joey]] 
315
316 >> As long as nothing has a filter() hook that assumes it's already
317 >> text... filters are run in arbitrary order. We seem to be OK so far
318 >> though.
319 >>
320 >> If this is the route I take, I propose to have the result of filter()
321 >> be the contents of the sidecar metadata file (empty string if none),
322 >> with the `\[[!albumimage]]` directive (which no longer requires
323 >> arguments) prepended if not already present. This would mean that
324 >> meta directives in the metadata file would work as normal, and it
325 >> would be possible to insert text both before and after the viewer
326 >> if desired. The result of filter() would also be a sensible starting
327 >> point for editing, and the result of editing could be diverted into
328 >> the metadata file. -s
329
330 do=edit&page=memes/badger needs to not put the JPG in a text box: somehow
331 divert or override the normal edit CGI by telling it that .albumimage
332 files are not editable in the usual way?
333
334 > Something I missed here is that editpage also needs to be told that
335 > creating new files of type albumjpg, albumgif etc. is not allowed
336 > either! -s
337
338 Every image needs to depend on, and link to, the next and previous images,
339 which is a bit tricky. In previous thinking about this I'd been applying
340 the overly strict constraint that the ordered sequence of pages in each
341 album must be known at scan time. However, that's not *necessarily* needed:
342 the album and each photo could collect an unordered superset of dependencies
343 at scan time, and at rebuild time that could be refined to be the exact set,
344 in order.
345
346 > Why do you need to collect this info at scan time? You can determine it
347 > at build time via `pagespec_match_list`, surely .. maybe with some
348 > memoization to avoid each image in an album building the same list.
349 > I sense that I may be missing a subtelty though. --[[Joey]] 
350
351 >> I think I was misunderstanding how early you have to call `add_depends`
352 >> as mentioned above. -s
353
354 Perhaps restricting to "the images in an album A must match A/*"
355 would be useful; then the unordered superset could just be "A/*". Your
356 "albums via tags" idea would be nice too though, particularly for feature
357 parity with e.g. Facebook: "photos of Joey" -> "tags/joey and albumimage()"
358 maybe?
359
360 If images are allowed to be considered to be part of more than one album,
361 then a pretty and usable UI becomes harder - "next/previous" expands into
362 "next photo in holidays/2009/germany / next photo in tagged/smcv / ..."
363 and it could get quite hard to navigate. Perhaps next/previous links could
364 be displayed only for the closest ancestor (in URL space) that is an
365 album, or something?
366
367 > Ugh, yeah, that is a problem. Perhaps wanting to support that was just
368 > too ambitious. --[[Joey]] 
369
370 >> I propose to restrict to having images be subpages of albums, as
371 >> described above. -s
372
373 Requiring renaming is awkward for non-technical Windows/Mac users, with both
374 platforms' defaults being to hide extensions; however, this could be
375 circumvented by adding some sort of hook in attachment to turn things into
376 a .albumimage at upload time, and declaring that using git/svn/... without
377 extensions visible is a "don't do that then" situation :-)
378
379 > Or extend `pagetype` so it can do the necessary matching without
380 > renaming. Maybe by allowing a subdirectory to be specified along
381 > with an extension. (Or allow specifying a full pagespec,
382 > but I hesitate to seriously suggest that.) --[[Joey]] 
383
384 >> I think that might be a terrifying idea for another day. If we can
385 >> mutate the extension during the `attach` upload, that'd be enough;
386 >> I don't think people who are skilled enough to use git/svn/...,
387 >> but not skilled enough to tell Explorer to show file extensions,
388 >> represent a major use case. -s
389
390 Ideally attachment could also be configured to upload into a specified
391 underlay, so that photos don't have to be in your source-code control
392 (you might want that, but I don't!).
393
394 > Replying to myself: perhaps best done as an orthogonal extension
395 > to attach? -s
396
397 > Yet another non-obvious thing this design would need to do is to find
398 > some way to have each change to memes/badger._albummeta show up as a
399 > change to memes/badger in `recentchanges`. -s
400
401 Things that would be nice, and are probably possible:
402
403 * make the "Edit page" link on viewers divert to album-specific CGI instead
404   of just failing or not appearing (probably possible via pagetemplate)
405
406 * some way to deep-link to memes/badger.jpg with a wikilink, without knowing a
407   priori that it's secretly a JPEG (probably harder than it looks - you'd
408   have to make a directive for it and it's probably not worth it)
409
410 ----
411
412 ## bug: unable to vary thumbnail size
413
414 Hi smcv, great plugin. I am an ikiwiki newbie but so far I've had success using your plugin.
415 I've integrated the jquery masonry plugin into the albumitem template and it works great.
416 But is there a way to create thumnails of different sizes? I've passed thumnailsize option
417 and value to album directive and while it does create the new thumbnail sizes it doesn't use them,
418 The 96x96 thumbnails still appear on the page no matter what I do. - jaime
419
420 > [[KathrynAndersen]] fixed this, see below. --[[smcv]]
421
422 ----
423
424 ## failed installation
425
426 Hi, the plugin looks great, but I am probably too dumb to use it ;( here is what I did:
427 created page gal.mdwn with just \[\[!album\]\] directive (no arguments) and subdirectory gal/ with images in form img_1234.jpg
428
429 when I run ikiwiki, I get something completely wrong though:
430
431 generated gal/index.html page contains following code repeated for every image:
432
433     <div class="album-viewer">
434       <div id="album-img">
435         <div class="album-finish">
436           <a href="./"><span class="album-arrow">↑</span></a>
437         </div>
438       </div>
439     </div>
440
441 So no links to any images, etc.
442
443 The pages for individual images are generated though, but also not correct. Trails section is perfect, but the main part is wrong:
444
445     <div class="album-prev">
446       <a><span class="album-arrow">â†<90></span></a><br />
447       <div class="album-thumbnail">
448         <span class="selflink">
449           <img src="./96x96-img_2913.jpg" width="96" height="72" alt="img 2913" title="img 2913" class="img" /></span>
450       </div>
451     </div>
452
453 This really seems like this should be in the album page and not individul page. It is only thumbnail and not full image. Also the full image is not in the generated html tree at all!
454
455 I am using ikiwiki 3.20130518, and got the album sources from the links of [this page](http://ikiwiki.info/plugins/contrib/album/) (part manual installation)
456
457 Any hint about what do I do wrong?
458
459 Thanks Lukas
460
461 > This plugin is not really finished. I probably need to update it for
462 > current ikiwiki. I'll try to update it (and also update my demo
463 > and installation instructions) at some point. --[[smcv]]
464
465 >> I have to appologize, I accidentally copied the template wrongly and that caused all the issues ;(
466 >> So now after two days debugging and tracing, I just fixed that and it works. Well, at least a learnt
467 >> a lot about ikiwiki internal ;-)
468 >> Thanks for all the work you did on the plugin! --Lukas
469
470 ----
471
472 ## bug + patch: not all images shown on album page
473
474 Hi smcv, we spoke on irc the other day. Passed `show => "0"` on line 126 in album.pm to remove the limit on the thumbnails shown on the album page. Setting it on the album directive didn't work.
475
476 --kjs
477
478 > That sounds like a correct solution. I'll fix that in my branch when I work on
479 > this again. --[[smcv]]
480
481 ----
482
483 ## bug: thumbnailsize doesn't work
484
485 As mentioned above by Jaime setting the thumbnailsize doesn't catch either. Or rather if I git push after changing the album directive the generated thumbnails (the image files) are the correct size as set in the directive. The html however uses the default thumbnailsize as hardcoded in album.pm and has broken thumbnails as it links to a file with the default size in the filename.
486
487 > [[KathrynAndersen]] fixed this, see below. --[[smcv]]
488
489 Issuing `ikiwiki --rebuild` knocks the system into another gear where the thumbnails show up correctly but this is only due to the html being the same as above (linking to hardcoded thumbnailsize) but the generated thumbnail images are now matching the hardcoded size ignoring the thumbnailsize attribute on the album directive.
490
491 For me this behaviour is way beyond my skills to sort out (I'm no coder). The albumplugin ikiwiki combo is very attractive to me and the plugin i soo close to working!
492
493 --kjs
494
495 ----
496
497 ## wishlist + patch: make clicking on the large image go to the next
498
499 I've changed the behavior of the "slideshow" to show the next image when clicking the large image as downloading a full resolution image is a rare use case in a gallery of this type imho. The large clicktarget means you are likely to unnecessarily download large files otherwise. I can't quite follow the template, album.pm flow so I can't figure out how to put a "download full resolution" link on the viewer page which would be my next step. To achieve the next link i added ` link => ($nextpage or $album),` around line 454 in `my $img`
500
501 --kjs
502
503 > That seems reasonable. I'll consider that when I work on this
504 > plugin again next. --[[smcv]]
505
506 ----
507
508 ## wishlist from kjs
509
510 My wishlist for the plugin would include:
511
512 - Reading exif info from the imagefile
513 - ~~Keeping the full resolution image files out of version control~~ Solved this by simply creating a underlay for the images. Works out of the box for my non cgi workflow.
514 - Being able to create new albums by tag or by manually picking images from other albums. Could be a simple comma separated list of viewer names, or even full urls, in the album directive.
515 - A counter showing **current image/total number of images in album**. This would mean that you know how many images you have left to click through before you have seen all images in an album. This gives you enought info to decide weather to click through or go back/leave.
516
517 --kjs
518
519 > I want the first two of those too, perhaps one day I'll get round to
520 > implementing them.
521 >
522 > For the third, you can get the same practical effect using an inline
523 > as documented in the main page. --[[smcv]]
524 >> The downside to current behaviour is that clicking an inlined thumbnail will take you to the original album context. Previous/Next image will not match the thumbnails in the inline but the thumbnails in the album. This is a bit confusing for users and prevents using the image in multiple contexts without duplicating the image. To achieve what I'm looking for there would have to be several AlbumViewer pages for a single image. --kjs
525
526 ----
527
528 ## suggested fix for thumbnail size bug
529
530 I've tracked down the "always showing the 96x96 thumbnails" bug!
531
532 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.
533
534 Here's a context-diff of my fix:
535
536 <pre>
537 *** /home/kat/files/repos/ikiwiki_smcv/IkiWiki/Plugin/album.pm  2013-12-18 14:50:06.861623226 +1100
538 --- album.pm    2013-12-18 15:51:09.393582879 +1100
539 ***************
540 *** 484,489 ****
541 --- 484,490 ----
542                 my $viewer = $params{page};
543                 my $album = $pagestate{$viewer}{album}{album};
544                 my $image = $pagestate{$viewer}{album}{image};
545 +                 my $thumbnailsize = $pagestate{$album}{album}{thumbnailsize};
546   
547                 return unless defined $album;
548                 return unless defined $image;
549 ***************
550 *** 495,501 ****
551   
552                 if ($template->query(name => 'thumbnail')) {
553                         $template->param(thumbnail =>
554 !                               thumbnail($viewer, $params{destpage}));
555                 }
556                 if (IkiWiki::isinlinableimage($image)
557                         && ($template->query(name => 'imagewidth') ||
558 --- 496,502 ----
559   
560                 if ($template->query(name => 'thumbnail')) {
561                         $template->param(thumbnail =>
562 !                               thumbnail($viewer, $params{destpage}, $thumbnailsize));
563                 }
564                 if (IkiWiki::isinlinableimage($image)
565                         && ($template->query(name => 'imagewidth') ||
566 </pre>
567
568 -- [[KathrynAndersen]]
569
570 > I haven't tried this change, but it seems sane. I'll apply it
571 > when I next work on this plugin.
572 >
573 > (OOI: why not a unified diff? The VCS world seems to have
574 > settled on those as universal, and I find them easier to
575 > read.)
576 >
577 > --[[smcv]]
578
579 ----
580
581 ## bug: inability to show more than 10 items
582
583 I've found another bug. The album plugin doesn't allow one to have more than 10 items in an album section. This is because it uses "inline" to display album sections, and the default for inline is to show only 10 items. So it only shows 10 items.
584
585 What would be good is if the album directive could have a "show" parameter which is passed on to preprocess_inline, so that users could decide how many items to show (including ALL of them, if they give show=0).
586
587 -- [[KathrynAndersen]]
588
589 > My intention was that all items would always be shown, so I would always pass
590 > `show => 0` to `preprocess_inline` (as kjs suggested above), but that must have
591 > got lost somewhere. I'll apply it next time I work on this plugin.
592 >
593 > An optional `show` parameter would be a possible enhancement beyond that,
594 > although I don't know how useful it would be; if it isn't passed, the
595 > default should be 0 (unlimited). --[[smcv]]
596
597 ----
598
599 ## bug?: all albums and pages become interdependent 
600 *(ikiwiki master branch 2014-06-06 and smcv album4 branch)*
601
602 On a site with the following structure where all album$n.mdwn files have the ``[[!album]]`` directive set. All albums and albumviewers get rebuilt whenever any one of the pages is touched and the command ``ikiwiki --setup debug.setup --refresh --verbose`` is issued.
603
604     /index.mdwn
605     |-album01.mdwn
606     |-album01/
607     | |-imgA.jpg
608     | |-imgB.jpg
609     |
610     |-album02.mdwn
611     |-album02/
612     | |-imgC.jpg
613     | |-imgD.jpg
614     |
615     |-album03.mdwn
616     |-album03/
617     | |-imgE.jpg
618     | |-imgF.jpg
619
620 This happens even if the indexpage has no links and when the tree is one level deeper than above with a folder between the index and each ``album$0n`` tuple. Touching index.mdwn rebuilds for instance imgF viewer and output like for example the following as a result of changing ``album01.mdwn``
621
622     building album02/imgC, its previous or next page has changed
623     building album03/imgE, its previous or next page has changed
624     building album02.mdwn, which depends on album02/imgC
625
626 In other words using the album plugin means all changes trigger full rebuilds (as far as I can tell). With my workflow this hasn't been much of an issue as my sites are static and updated maximum once a week but it does make comments unfeasible.
627
628 Perhaps there is something in my setup that triggers this problem? If anyone has an ikiwiki album installation where ``--refresh`` limits the scope of the rebuild to just one album I'd be interested to hear. See <http://img.kalleswork.net> for an live website that has this problem. I've tested a simpler debug site without any customization as well.
629
630