1 ## installation queries from brush
3 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.
5 > That's my goal eventually, too. Perhaps you can help to
6 > design/write this plugin? At the moment I'm mostly
7 > waiting for a design "sanity check" from [[Joey]],
8 > but any feedback you can provide on the design would
9 > also be helpful. --[[smcv]]
11 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?
13 > Those are all the added files; ikiwiki-album isn't strictly
14 > needed (IkiWiki itself doesn't use that code, but you can
15 > use it to turn a directory full of images into correct
16 > input for the album plugin).
18 > You probably also want the album plugin's expanded version of
19 > style.css (or put its extra rules in your local.css).
20 > Without that, your albums will be quite ugly.
22 > There aren't currently any other files modified by my branch.
25 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?
27 > Images are just attachments, and viewers are pages (any supported
28 > format, but .html will be fastest to render). Attach each image,
29 > then write a page for each image containing the
30 > \[[!albumimage]] directive (usually it will *only* contain that
33 > The script ikiwiki-album can help you to do this in a git/svn/etc.
34 > tree; doing it over the web will be a lot of work (until I get
35 > the CGI interface written), but it should already be possible!
37 > The structure is something like this:
39 > * album.mdwn (contains the \[[!album]] directive, and perhaps also
40 > some \[[!albumsection]] directives)
42 > * album/a.html (contains the \[[!albumimage]] directive for a.jpg)
44 > * album/b.html (contains the \[[!albumimage]] directive for b.jpg)
46 > Have a look at ikiwiki-album to see how the directives are meant to
51 >> In the current version of the branch, the viewer pages are
52 >> generated automatically if you didn't generate them yourself,
53 >> so `ikiwiki-album` is no longer needed. --[[smcv]]
55 i'm new to ikiwiki, apologies if this is dealt with elsewhere. -brush
57 > This plugin is pretty ambitious, and is unfinished, so I'd recommend
58 > playing with a normal IkiWiki installation for a bit, then trying
59 > out this plugin when you've mastered the basics of IkiWiki. --[[smcv]]
63 ## design feedback from joeyh on an earlier version
65 Not entirely relevant any more.
66 [[!toggle id="old-design-feedback" text="show"]]
67 [[!toggleable id="old-design-feedback" text="""
68 [[!toggle id="old-design-feedback" text="hide"]]
70 You had wanted my feedback on the design of this. I have not looked at the
71 code or tried it yet, but here goes. --[[Joey]]
73 * Needing to create the albumimage "viewer" pages for each photo
74 seems like it will become a pain. Everyone will need to come up
75 with their own automation for it, and then there's the question
76 of how to automate it when uploading attachments. -J
78 > There's already a script (ikiwiki-album) to populate a git
79 > checkout with skeleton "viewer" pages; I was planning to make a
80 > specialized CGI interface for albums after getting feedback from
81 > you (since the requirements for that CGI interface change depending
82 > on the implementation). I agree that this is ugly, though. -s
84 >> Would you accept a version where the albumimage "viewer" pages
85 >> could be 0 bytes long, at least until metadata gets added?
87 >> The more I think about the "binaries as first-class pages" approach,
88 >> the more subtle interactions I notice with other plugins. I
89 >> think I'm up to needing changes to editpage, comments, attachment
90 >> and recentchanges, plus adjustments to img and Render (to reduce
91 >> duplication when thumbnailing an image with a strange extension
92 >> while simultaneously changing the extension, and to hardlink/copy
93 >> an image with a strange extension to a differing target filename
94 >> with the normal extension, respectively). -s
96 >>> Now that we have `add_autofile` I can just create viewer pages
97 >>> whenever there's an image to view. The current version of the
98 >>> branch does that. -s
100 * With each viewer page having next/prev links, I can see how you
101 were having the scalability issues with ikiwiki's data structures
104 > Yeah, I think they're a basic requirement from a UI point of view
105 > though (although they don't necessarily have to be full wikilinks).
108 >> I think that with the new dependency types system, the dependencies for
109 >> these can be presence dependencies, which will probably help with
110 >> avoiding rebuilds of a page if the next/prev page is changed.
111 >> (Unless you use img to make the thumbnails for those links, then it
112 >> would rebuild the thumbnails anyway. Have not looked at the code.) --[[Joey]]
116 * And doesn't each viewer page really depend on every other page in the
117 same albumsection? If a new page is added, the next/prev links
118 may need to be updated, for example. If so, there will be much
119 unnecessary rebuilding. -J
121 > albumsections are just a way to insert headings into the flow of
122 > photos, so they don't actually affect dependencies.
124 > One non-obvious constraint of ikiwiki's current design is that
125 > everything "off-page" necessary to build any page has to happen
126 > at scan time, which has caused a few strange design decisions,
127 > like the fact that each viewer controls what album it's in.
129 > It's difficult for the contents of the album to just be a
130 > pagespec, like for inline, because pagespecs can depend on
131 > metadata, which is gathered in arbitrary order at scan time;
132 > so the earliest you can safely apply a pagespec to the wiki
133 > contents to get a concrete list of pages is at rebuild time.
135 > (This stalled my attempt at a trail plugin, too.) -s
137 >> Not sure I understand why these need to look at pagespecs at scan time?
138 >> Also, note that it is fairly doable to detect if a pagespec uses such
139 >> metadata. Er, I mean, I have a cheezy hack in `add_depends` now that does
140 >> it to deal with a similar case. --[[Joey]]
142 >>> I think I was misunderstanding how early you have to call `add_depends`?
143 >>> The critical thing I missed was that if you're scanning a page, you're
144 >>> going to rebuild it in a moment anyway, so it doesn't matter if you
145 >>> have no idea what it depends on until the rebuild phase. -s
147 * One thing I do like about having individual pages per image is
148 that they can each have their own comments, etc. -J
150 > Yes; also, they can be wikilinked. I consider those to be
151 > UI requirements. -s
153 * Seems possibly backwards that the albumimage controls what album
154 an image appears in. Two use cases -- 1: I may want to make a locked
155 album, but then anyone who can write to any other page on the wiki can
156 add an image to it. 2: I may want an image to appear in more than one
157 album. Think tags. So it seems it would be better to have the album
158 directive control what pages it includes (a la inline). -J
160 > I'm inclined to fix this by constraining images to be subpages of exactly
161 > one album: if they're subpages of 2+ nested albums then they're only
162 > considered to be in the deepest-nested one (i.e. longest URL), and if
163 > they're not in any album then that's a usage error. This would
164 > also make prev/next links sane. -s
166 >> The current version constrains images to be in at most one album,
167 >> choosing one arbitrarily (dependent on scan order) if albums are
170 > If you want to reference images from elsewhere in the wiki and display
171 > them as if in an album, then you can use an ordinary inline with
172 > the same template that the album would use, and I'll make sure the
173 > templates are set up so this works. -s
175 >> Still needs documenting, I've put it on the TODO list on the main
178 > (Implementation detail: this means that an image X/Y/Z/W/V, where X and
179 > Y are albums, Z does not exist and W exists but is not an album,
180 > would have a content dependency on Y, a presence dependency on Z
181 > and a content dependency on W.)
183 > Perhaps I should just restrict to having the album images be direct
184 > subpages of the album, although that would mean breaking some URLs
185 > on the existing website I'm doing all this work for... -s
187 >> The current version of the branch doesn't have this restriction;
188 >> perhaps it's a worthwhile simplification, or perhaps it's too
189 >> restrictive? I fairly often use directory hierarchies like
190 >> `a_festival/saturday/foo.jpg` within an album, which makes
191 >> it very easy to write `albumsection` filters. -s
193 * Putting a few of the above thoughts together, my ideal album system
194 seems to be one where I can just drop the images into a directory and
195 have them appear in the album index, as well as each generate their own wiki
196 page. Plus some way I can, later, edit metadata for captions,
197 etc. (Real pity we can't just put arbitrary metadata into the images
198 themselves.) This is almost pointing toward making the images first-class
199 wiki page sources. Hey, it worked for po! :) But the metadata and editing
200 problems probably don't really allow that. -J
202 > Putting a JPEG in the web form is not an option from my point of
203 > view :-) but perhaps there could just be a "web-editable" flag supplied
204 > by plugins, and things could be changed to respect it.
206 >> Replying to myself: would you accept patches to support
207 >> `hook(type => 'htmlize', editable => 0, ...)` in editpage? This would
208 >> essentially mean "this is an opaque binary: you can delete it
209 >> or rename it, and it might have its own special editing UI, but you
210 >> can never get it in a web form".
212 >> On the other hand, that essentially means we need to reimplement
213 >> editpage in order to edit the sidecar files that contain the metadata.
214 >> Having already done one partial reimplementation of editpage (for
215 >> comments) I'm in no hurry to do another.
217 >> I suppose another possibility would be to register hook
218 >> functions to be called by editpage when it loads and saves the
219 >> file. In this case, the loading hook would be to discard
220 >> the binary and use filter() instead, and the saving conversion
221 >> would be to write the edited content into the metadata sidecar
222 >> (creating it if necessary).
224 >> I'd also need to make editpage (and also comments!) not allow the
225 >> creation of a file of type albumjpg, albumgif etc., which is something
226 >> I previously missed; and I'd need to make attachment able to
227 >> upload-and-rename.
230 >>> I believe the current branch meets your requirements, by having
231 >>> first-class wiki pages spring into existence using `add_autofile`
232 >>> to be viewer pages for photos. -s
234 > In a way, what you really want for metadata is to have it in the album
235 > page, so you can batch-edit the whole lot by editing one file (this
236 > does mean that editing the album necessarily causes each of its viewers
237 > to be rebuilt, but in practice that happens anyway). -s
239 >> Replying to myself: in practice that *doesn't* happen anyway. Having
240 >> the metadata in the album page is somewhat harmful because it means
241 >> that changing the title of one image causes every viewer in the album
242 >> to be rebuilt, whereas if you have a metadata file per image, only
243 >> the album itself, plus the next and previous viewers, need
244 >> rebuilding. So, I think a file per image is the way to go.
246 >> Ideally we'd have some way to "batch-edit" the metadata of all
247 >> images in an album at once, except that would make conflict
248 >> resolution much more complicated to deal with; maybe just
249 >> give up and scream about mid-air collisions in that case?
250 >> (That's apparently good enough for Bugzilla, but not really
253 >>> This is now in the main page's TODO list; if/when I implement this,
254 >>> I intend to make it a specialized CGI interface. -s
256 >> Yes, [all metadata in one file] would make some sense.. It also allows putting one image in
257 >> two albums, with different caption etc. (Maybe for different audiences.)
260 >>> Eek. No, that's not what I had in mind at all; the metadata ends up
261 >>> in the "viewer" page, so it's necessarily the same for all albums. -s
263 >> It would probably be possible to add a new dependency type, and thus
264 >> make ikiwiki smart about noticing whether the metadata has actually
265 >> changed, and only update those viewers where it has. But the dependency
266 >> type stuff is still very new, and not plugin friendly .. so only just
267 >> possible, --[[Joey]]
272 ## alternative "special extension" design (conclusion: "don't")
274 '''I think the "special extension" design is a dead-end, but here's what
275 happened when I tried to work out how it would work. --[[smcv]]'''
277 [[!toggle id="special-extension-sketch" text="show"]]
278 [[!toggleable id="special-extension-sketch" text="""
279 [[!toggle id="special-extension-sketch" text="hide"]]
281 Suppose that each viewer is a JPEG-or-GIF-or-something, with extension
282 ".albumimage". We have a gallery "memes" with three images, badger,
285 > An alternative might be to use ".album.jpg", and ".album.gif"
286 > etc as the htmlize extensions. May need some fixes to ikiwiki to support
289 >> foo.albumjpg (etc.) for images, and foo._albummeta (with
290 >> `keepextension => 1`) for sidecar metadata files, seems viable. -s
296 * memes/badger.albumjpg (a renamed JPEG)
297 * memes/badger/comment_1._comment
298 * memes/badger/comment_2._comment
299 * memes/mushroom.albumgif (a renamed GIF)
300 * memes/mushroom._albummeta (sidecar file with metadata)
301 * memes/snake.albummov (a renamed video)
303 Files in web content:
307 * memes/96x96-badger.jpg (from img)
308 * memes/96x96-mushroom.gif (from img)
309 * memes/96x96-snake.jpg (from img, hacked up to use totem-video-thumbnailer :-) )
310 * memes/badger/index.html (including comments)
312 * memes/mushroom/index.html
314 * memes/snake/index.html
317 ispage("memes/badger") (etc.) must be true, to make the above rendering
318 happen, so albumimage needs to be a "page" extension.
320 To not confuse other plugins, album should probably have a filter() hook
321 that turns .albumimage files into HTML? That'd probably be a reasonable
322 way to get them rendered anyway.
324 > I guess that is needed to avoid preprocess, scan, etc trying to process
325 > the image, as well as eg, smiley trying to munge it in sanitize.
328 >> As long as nothing has a filter() hook that assumes it's already
329 >> text... filters are run in arbitrary order. We seem to be OK so far
332 >> If this is the route I take, I propose to have the result of filter()
333 >> be the contents of the sidecar metadata file (empty string if none),
334 >> with the `\[[!albumimage]]` directive (which no longer requires
335 >> arguments) prepended if not already present. This would mean that
336 >> meta directives in the metadata file would work as normal, and it
337 >> would be possible to insert text both before and after the viewer
338 >> if desired. The result of filter() would also be a sensible starting
339 >> point for editing, and the result of editing could be diverted into
340 >> the metadata file. -s
342 do=edit&page=memes/badger needs to not put the JPG in a text box: somehow
343 divert or override the normal edit CGI by telling it that .albumimage
344 files are not editable in the usual way?
346 > Something I missed here is that editpage also needs to be told that
347 > creating new files of type albumjpg, albumgif etc. is not allowed
350 Every image needs to depend on, and link to, the next and previous images,
351 which is a bit tricky. In previous thinking about this I'd been applying
352 the overly strict constraint that the ordered sequence of pages in each
353 album must be known at scan time. However, that's not *necessarily* needed:
354 the album and each photo could collect an unordered superset of dependencies
355 at scan time, and at rebuild time that could be refined to be the exact set,
358 > Why do you need to collect this info at scan time? You can determine it
359 > at build time via `pagespec_match_list`, surely .. maybe with some
360 > memoization to avoid each image in an album building the same list.
361 > I sense that I may be missing a subtelty though. --[[Joey]]
363 >> I think I was misunderstanding how early you have to call `add_depends`
364 >> as mentioned above. -s
366 Perhaps restricting to "the images in an album A must match A/*"
367 would be useful; then the unordered superset could just be "A/*". Your
368 "albums via tags" idea would be nice too though, particularly for feature
369 parity with e.g. Facebook: "photos of Joey" -> "tags/joey and albumimage()"
372 If images are allowed to be considered to be part of more than one album,
373 then a pretty and usable UI becomes harder - "next/previous" expands into
374 "next photo in holidays/2009/germany / next photo in tagged/smcv / ..."
375 and it could get quite hard to navigate. Perhaps next/previous links could
376 be displayed only for the closest ancestor (in URL space) that is an
379 > Ugh, yeah, that is a problem. Perhaps wanting to support that was just
380 > too ambitious. --[[Joey]]
382 >> I propose to restrict to having images be subpages of albums, as
383 >> described above. -s
385 Requiring renaming is awkward for non-technical Windows/Mac users, with both
386 platforms' defaults being to hide extensions; however, this could be
387 circumvented by adding some sort of hook in attachment to turn things into
388 a .albumimage at upload time, and declaring that using git/svn/... without
389 extensions visible is a "don't do that then" situation :-)
391 > Or extend `pagetype` so it can do the necessary matching without
392 > renaming. Maybe by allowing a subdirectory to be specified along
393 > with an extension. (Or allow specifying a full pagespec,
394 > but I hesitate to seriously suggest that.) --[[Joey]]
396 >> I think that might be a terrifying idea for another day. If we can
397 >> mutate the extension during the `attach` upload, that'd be enough;
398 >> I don't think people who are skilled enough to use git/svn/...,
399 >> but not skilled enough to tell Explorer to show file extensions,
400 >> represent a major use case. -s
402 Ideally attachment could also be configured to upload into a specified
403 underlay, so that photos don't have to be in your source-code control
404 (you might want that, but I don't!).
406 > Replying to myself: perhaps best done as an orthogonal extension
409 > Yet another non-obvious thing this design would need to do is to find
410 > some way to have each change to memes/badger._albummeta show up as a
411 > change to memes/badger in `recentchanges`. -s
413 Things that would be nice, and are probably possible:
415 * make the "Edit page" link on viewers divert to album-specific CGI instead
416 of just failing or not appearing (probably possible via pagetemplate)
418 * some way to deep-link to memes/badger.jpg with a wikilink, without knowing a
419 priori that it's secretly a JPEG (probably harder than it looks - you'd
420 have to make a directive for it and it's probably not worth it)
425 ## resolved bug reports
427 [[!toggle id="fixed-bugs" text="show"]]
428 [[!toggleable id="fixed-bugs" text="""
429 [[!toggle id="fixed-bugs" text="hide"]]
431 ### bug: unable to vary thumbnail size
433 Hi smcv, great plugin. I am an ikiwiki newbie but so far I've had success using your plugin.
434 I've integrated the jquery masonry plugin into the albumitem template and it works great.
435 But is there a way to create thumnails of different sizes? I've passed thumnailsize option
436 and value to album directive and while it does create the new thumbnail sizes it doesn't use them,
437 The 96x96 thumbnails still appear on the page no matter what I do. - jaime
439 > Fixed in album5 branch, thanks to [[KathrynAndersen]]. --[[smcv]]
443 ### failed installation
445 Hi, the plugin looks great, but I am probably too dumb to use it ;( here is what I did:
446 created page gal.mdwn with just \[\[!album\]\] directive (no arguments) and subdirectory gal/ with images in form img_1234.jpg
448 when I run ikiwiki, I get something completely wrong though:
450 generated gal/index.html page contains following code repeated for every image:
452 <div class="album-viewer">
454 <div class="album-finish">
455 <a href="./"><span class="album-arrow">↑</span></a>
460 So no links to any images, etc.
462 The pages for individual images are generated though, but also not correct. Trails section is perfect, but the main part is wrong:
464 <div class="album-prev">
465 <a><span class="album-arrow">â†<90></span></a><br />
466 <div class="album-thumbnail">
467 <span class="selflink">
468 <img src="./96x96-img_2913.jpg" width="96" height="72" alt="img 2913" title="img 2913" class="img" /></span>
472 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!
474 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)
476 Any hint about what do I do wrong?
480 > This plugin is not really finished. I probably need to update it for
481 > current ikiwiki. I'll try to update it (and also update my demo
482 > and installation instructions) at some point. --[[smcv]]
484 >> I have to appologize, I accidentally copied the template wrongly and that caused all the issues ;(
485 >> So now after two days debugging and tracing, I just fixed that and it works. Well, at least a learnt
486 >> a lot about ikiwiki internal ;-)
487 >> Thanks for all the work you did on the plugin! --Lukas
491 ### bug + patch: not all images shown on album page
493 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.
497 > That sounds like a correct solution. I'll fix that in my branch when I work on
498 > this again. --[[smcv]]
500 >> Fixed in `album5` branch --s
504 ### bug: thumbnailsize doesn't work
506 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.
508 > [[KathrynAndersen]] fixed this, see below. --[[smcv]]
510 >> Fixed in `album5` branch --s
512 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.
514 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!
518 ### suggested fix for thumbnail size bug
520 I've tracked down the "always showing the 96x96 thumbnails" bug!
522 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.
524 Here's a context-diff of my fix:
527 *** /home/kat/files/repos/ikiwiki_smcv/IkiWiki/Plugin/album.pm 2013-12-18 14:50:06.861623226 +1100
528 --- album.pm 2013-12-18 15:51:09.393582879 +1100
532 my $viewer = $params{page};
533 my $album = $pagestate{$viewer}{album}{album};
534 my $image = $pagestate{$viewer}{album}{image};
535 + my $thumbnailsize = $pagestate{$album}{album}{thumbnailsize};
537 return unless defined $album;
538 return unless defined $image;
542 if ($template->query(name => 'thumbnail')) {
543 $template->param(thumbnail =>
544 ! thumbnail($viewer, $params{destpage}));
546 if (IkiWiki::isinlinableimage($image)
547 && ($template->query(name => 'imagewidth') ||
550 if ($template->query(name => 'thumbnail')) {
551 $template->param(thumbnail =>
552 ! thumbnail($viewer, $params{destpage}, $thumbnailsize));
554 if (IkiWiki::isinlinableimage($image)
555 && ($template->query(name => 'imagewidth') ||
558 -- [[KathrynAndersen]]
560 > I haven't tried this change, but it seems sane. I'll apply it
561 > when I next work on this plugin.
563 > (OOI: why not a unified diff? The VCS world seems to have
564 > settled on those as universal, and I find them easier to
569 >> Fixed in `album5` --s
573 ### bug: inability to show more than 10 items
575 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.
577 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).
579 -- [[KathrynAndersen]]
581 > My intention was that all items would always be shown, so I would always pass
582 > `show => 0` to `preprocess_inline` (as kjs suggested above), but that must have
583 > got lost somewhere. I'll apply it next time I work on this plugin.
585 > An optional `show` parameter would be a possible enhancement beyond that,
586 > although I don't know how useful it would be; if it isn't passed, the
587 > default should be 0 (unlimited). --[[smcv]]
589 >> Fixed in `album5` --s
593 ### cbaines' commit to change default thumbnail size
595 Regarding commit `Change the default thumbnail size`: as far as I
596 understand it, `size => 96x96` is meant to set the image size to
597 be as large as possible given these constraints: width ≤ 96px,
598 height ≤ 96px, and the original aspect ratio is preserved. So I
599 would hope that 96x96 doesn't distort the thumbnails. What distortion
600 are you seeing, and which versions of Imagemagick and Perlmagick
605 > I rebuilt the examples using both your album4 and album5 branches, and I only
606 > see this in the album4 branch. So this is probably ok to ignore.
609 >> OK, I'll assume that was a duplicate of an earlier patch, probably the
610 >> one from KathrynAndersen. --s
616 ## wishlist + patch: make clicking on the large image go to the next
618 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`
622 > That seems reasonable. I'll consider that when I work on this
623 > plugin again next. --[[smcv]]
629 My wishlist for the plugin would include:
631 - Reading exif info from the imagefile
632 - ~~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.
633 - 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.
634 - 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.
638 > I want the first two of those too, perhaps one day I'll get round to
641 > For the third, you can get the same practical effect using an inline
642 > as documented in the main page. --[[smcv]]
643 >> 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
645 >>> Hmm, OK. That breaks the "one picture : one page" mental model,
646 >>> unfortunately. The pictures themselves can't be first-class wiki pages (see
647 >>> lengthy design discussions with Joey above) because they aren't something
648 >>> that produces HTML, and don't have human-readable text source code.
649 >>> In the current (album5) design, the viewer pages that are automatically
650 >>> created to go alongside the pictures are basically stand-ins for the
651 >>> pictures, as far as metadata, wikilinks, tags and other "first-class
652 >>> wiki page" things are concerned. --s
654 >>>> I can see why it's important to keep these models simple and have figured out
655 >>>> that the viewer pages are stand-ins for the image. Just as a tought though. If
656 >>>> this relationship was made more explicit ie. the viewer pages *are the content*
657 >>>> just initially generated from the image metadata with a link to the image. Then
658 >>>> the mental model would stay intact and more in line with how html and the
659 >>>> implementation works.
661 >>>> One thing to point out is that last time I tried pages can be members of
662 >>>> arbitrary numbers of trails/albums. You just get multiple rows of navigation, one
663 >>>> for each trail. This doesn't quite work as it's hard to know which one to click.
667 >>>>> Pages can be part of arbitrarily many trails, yes - that's a consequence of
668 >>>>> how trails are created. If you can think of a better way to present a page
669 >>>>> that's in more than one trail, I'd welcome ideas... I did originally have an
670 >>>>> implementation where only one trail would generate links, but when I tried
671 >>>>> it on some (rather artificial) overlapping trails, the result was more
674 >>> If there are to be viewer pages elsewhere in the wiki, I don't think
675 >>> inheriting the picture's metadata is desired. Suppose you have a
676 >>> picture of Alice and Bob in the album "holiday in Exampleton, 2010",
677 >>> and it is tagged people/alice, people/bob and places/exampleton; the
678 >>> other contexts it appears in might include "pictures of Alice" and
679 >>> "pictures near Exampleton". If you look at the tag page for
680 >>> places/exampleton, I doubt you want to see that photo listed three
681 >>> times - once is enough, there's only one actual photo after all. So
682 >>> I think the "main" viewer page should be the only one that has
683 >>> the taglinks for people/alice, people/bob, places/exampleton.
686 >>>> The problem exposed by the tag page issue is very tricky. As you'd
687 >>>> probably want the exif info, captions and titles to transfer. Just not
688 >>>> necessarily the tags.
691 >>> My next question is, should the viewer page representing that
692 >>> particular picture in its context of "pictures near Exampleton"
693 >>> (i.e. its "next" and "previous" links go to the next and
694 >>> previous picture near Exampleton, regardless of whether it was
695 >>> on an earlier or later visit) be a first-class wiki page
699 >>> * Does it make any sense to comment on "this picture in this
700 >>> context", if your wiki has comments, or should the only
701 >>> place you can comment on it be its "main" viewer page?
702 >>> * Is there any need for it to be possible to make a wikilink
703 >>> to that particular picture in that particular context,
704 >>> or does it only need wikilinks "to the picture" (which,
705 >>> as an implementation detail, really go to its "main" viewer
707 >>> * Can the picture in that particular context have tags
708 >>> that are orthogonal to the tags its "main" viewer page has?
709 >>> * ... and so on for various wiki features
711 >>> It sound as though the answer might ideally be that this secondary
712 >>> viewer page doesn't need to be a first-class wiki page at all,
713 >>> only a HTML output... except that the trail plugin works in terms
714 >>> of next and previous first-class wiki pages, not next and
715 >>> previous HTML outputs, and the HTML-generation pipeline
716 >>> is really aimed towards real pages.
718 >>> Perhaps the secondary viewer page should end up looking
719 >>> something like this:
721 >>> \[[!albumviewer original=holiday-in-exampleton-2010/img1234
722 >>> comment="To edit picture metadata, edit the original page instead"]]
724 >>> and one of the side-effects of the albumviewer directive should be to
725 >>> replace [[plugins/comments]] with a link to the original? --s
727 >>>> One thing to consider is the built in difference between the original and
728 >>>> the secondary inferred by the fact that the first is an `album` the second
731 >>>>> I had assumed that both the "original" album (the one where the picture
732 >>>>> is physically located), and any other places you wanted to display it,
733 >>>>> would be some other directive whose implementation includes a call to
734 >>>>> `preprocess_inline`. `inline` on its own is not enough to create
735 >>>>> viewer pages to display the pictures, regardless of whether you
736 >>>>> want them to be one-per-picture or many-per-picture, and I'm not
737 >>>>> going to wedge yet more functionality into that plugin :-)
739 >>>>> It might be a good idea for the thing that displays pictures not
740 >>>>> physically located below that point to be a different directive, yes.
743 >>>> ### Single viewer
744 >>>> For my own usecase what you describe makes sense. I see the content of an inline object
745 >>>> (struggling a bit with what terms to user here) as a particular composition of
746 >>>> viewers. Perhaps comments should only be possible on the page with the inline rather
747 >>>> than the secondary viewer pages as the inline page not the image viewer is
748 >>>> the first-class page in this scenario? The inline page would also be the page you tag
749 >>>> etc. to make it show up in various contexts such as the tag page.
751 >>>> With the thinking outlined above I'd say that the secondary viewer should be a
752 >>>> non editable clone of the original viewer without any source. Just html output with
753 >>>> backlinks to the original page. This means that there are limitations to how these
754 >>>> secondary viewers can be used as the title, caption etc might fit some contexts
755 >>>> better than others. Personally this is fine as I see these inline based albums as
756 >>>> compositions or views on existing content.
759 >>>>> This is basically what I thought at first, but I realised while
760 >>>>> writing my earlier comments that it would be necessary
761 >>>>> to hack up [[plugins/trail]] fairly seriously to make it produce
762 >>>>> a trail through things that are not first-class wiki pages, and
763 >>>>> I'm not sure how much it would be necessary to subvert the
764 >>>>> rendering pipeline to get the right parentlinks and so on. --s
766 >>>> ###Multiple viewers alternative
767 >>>> The alternative is having a page say in `/story/album.mdwn` with the following directive
768 >>>> \[[!inline pages="/01/IMGP6494 or /02/IMGP6601 or /04/IMGP6922" sort="title" show="0" template="albumitem"]]
769 >>>> that creates new fully fledged editable viewers for each image in `/story/album/'
770 >>>> without tags being auto populated but backlinks to the original album viewer.
773 >>>>> It can't *only* be an inline, because an inline wouldn't generate the
774 >>>>> viewer pages, but I see what you mean. --s
776 >>>>>> That's actually excellent as the inline is a very useful feature
777 >>>>>> the way it works now. I started writing about this yesterday but
778 >>>>>> got interrupted. My indexes of albums use the inline in it's current
781 >>>> This would make the viewers completely independent allowing for unique titles, captions and comments
782 >>>> depending on context. Very useful when creating powerpoint like slideshows where you might need
783 >>>> different captions depending on the context. In your example wiki with photos from gigs this would allow
784 >>>> a page with an album inline about stage lighting with a selections of images and captions that highlight
785 >>>> relevant things in the image as well as a separate inline album page, with some of the same images,
786 >>>> about drumming styles and posture/grip of drummers.
788 >>>> I started writing all this supporting your single page case but looking at it now from my limited
789 >>>> understanding of how ikiwiki works it seems the multiple viewers option is conceptually cleaner
790 >>>> and more flexible. It relies on three things:
792 >>>> * A mental model where the viewer page is the content not the image
793 >>>> * That tags aren't automatically transferred from the original context. This doesn't seem that critical however.
794 >>>> * Backlinks to the other places the image is used.
798 I've added "--k" to some of your comments so other readers (possibly including
799 my future self) can keep track of our conversation, I hope you don't mind :-)
804 ## cbaines' CSS changes
806 Regarding the CSS changes: I'll try to have a look soon, work out
807 what actually changed (since you re-ordered the CSS, so it isn't
808 immediately obvious from the diff), and integrate some or all of your
809 changes. Since Joey shows no signs of wanting to merge it, and "out of tree"
810 installation is currently a pain, I might split out the CSS changes into a
811 separate `ikiwiki/album.css` so that the only thing that needs to be merged
812 into style.css (or into local.css) is an appropriate
815 It shouldn't be necessary to add the album stuff to each individual
816 theme's style.css unless you actually want an actiontabs album and
817 a blueview album to be styled differently, because the IkiWiki Makefile
818 concatenates them: for instance, `/usr/share/ikiwiki/themes/actiontabs/style.css`
819 is the output of `cat doc/style.css themes/actiontabs/style.css`. So adding it
820 to `doc/style.css` should be enough? --[[smcv]]
822 > I don't think this is the case? Or at least, looking at the generated
823 > stylesheet for the examples built using my branch, I would expect there to be
824 > two copies of the album rules in the stylesheet [1], but there does not
825 > appear to be. This could quite easily be a result of some mistake in my part
826 > in not isolating the build though. --[[cbaines]]
828 > 1: <http://cbaines.net/projects/ikiwiki/album/dest/basic-actiontabs/style.css>
830 >> I searched for `/* relevant to the index page */` and found it twice,
831 >> so I stand by what I said :-) --s
833 >>> And right you are, unsure how I missed that. My album branch is now rebased
834 >>> on your album5 branch (with the two now useless commits removed).