X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cd5bf7eb7f74c2414a87c77141ed0c502ff7f464..13c390389a6f5d76840da205d89d10355542eaf7:/doc/plugins/contrib/album/discussion.mdwn diff --git a/doc/plugins/contrib/album/discussion.mdwn b/doc/plugins/contrib/album/discussion.mdwn index 156cd7ad8..7174fa929 100644 --- a/doc/plugins/contrib/album/discussion.mdwn +++ b/doc/plugins/contrib/album/discussion.mdwn @@ -46,6 +46,10 @@ secondly: barring the CGI interface for editing the album, which would be great, > > --[[smcv]] +>> In the current version of the branch, the viewer pages are +>> generated automatically if you didn't generate them yourself, +>> so `ikiwiki-album` is no longer needed. --[[smcv]] + i'm new to ikiwiki, apologies if this is dealt with elsewhere. -brush > This plugin is pretty ambitious, and is unfinished, so I'd recommend @@ -54,13 +58,15 @@ i'm new to ikiwiki, apologies if this is dealt with elsewhere. -brush ---- +## design feedback from joeyh on an earlier version + You had wanted my feedback on the design of this. I have not looked at the code or tried it yet, but here goes. --[[Joey]] * Needing to create the albumimage "viewer" pages for each photo seems like it will become a pain. Everyone will need to come up with their own automation for it, and then there's the question - of how to automate it when uploading attachments. + of how to automate it when uploading attachments. -J > There's already a script (ikiwiki-album) to populate a git > checkout with skeleton "viewer" pages; I was planning to make a @@ -69,11 +75,24 @@ code or tried it yet, but here goes. --[[Joey]] > on the implementation). I agree that this is ugly, though. -s >> Would you accept a version where the albumimage "viewer" pages ->> could be 0 bytes long, at least until metadata gets added? -s +>> could be 0 bytes long, at least until metadata gets added? +>> +>> The more I think about the "binaries as first-class pages" approach, +>> the more subtle interactions I notice with other plugins. I +>> think I'm up to needing changes to editpage, comments, attachment +>> and recentchanges, plus adjustments to img and Render (to reduce +>> duplication when thumbnailing an image with a strange extension +>> while simultaneously changing the extension, and to hardlink/copy +>> an image with a strange extension to a differing target filename +>> with the normal extension, respectively). -s + +>>> Now that we have `add_autofile` I can just create viewer pages +>>> whenever there's an image to view. The current version of the +>>> branch does that. -s * With each viewer page having next/prev links, I can see how you were having the scalability issues with ikiwiki's data structures - earlier! + earlier! -J > Yeah, I think they're a basic requirement from a UI point of view > though (although they don't necessarily have to be full wikilinks). @@ -85,10 +104,12 @@ code or tried it yet, but here goes. --[[Joey]] >> (Unless you use img to make the thumbnails for those links, then it >> would rebuild the thumbnails anyway. Have not looked at the code.) --[[Joey]] +>>> I do use img. -s + * And doesn't each viewer page really depend on every other page in the same albumsection? If a new page is added, the next/prev links may need to be updated, for example. If so, there will be much - unnecessary rebuilding. + unnecessary rebuilding. -J > albumsections are just a way to insert headings into the flow of > photos, so they don't actually affect dependencies. @@ -117,7 +138,7 @@ code or tried it yet, but here goes. --[[Joey]] >>> have no idea what it depends on until the rebuild phase. -s * One thing I do like about having individual pages per image is - that they can each have their own comments, etc. + that they can each have their own comments, etc. -J > Yes; also, they can be wikilinked. I consider those to be > UI requirements. -s @@ -127,19 +148,26 @@ code or tried it yet, but here goes. --[[Joey]] album, but then anyone who can write to any other page on the wiki can add an image to it. 2: I may want an image to appear in more than one album. Think tags. So it seems it would be better to have the album - directive control what pages it includes (a la inline). + directive control what pages it includes (a la inline). -J > I'm inclined to fix this by constraining images to be subpages of exactly > one album: if they're subpages of 2+ nested albums then they're only > considered to be in the deepest-nested one (i.e. longest URL), and if > they're not in any album then that's a usage error. This would -> also make prev/next links sane. -> +> also make prev/next links sane. -s + +>> The current version constrains images to be in at most one album, +>> choosing one arbitrarily (dependent on scan order) if albums are +>> nested. -s + > If you want to reference images from elsewhere in the wiki and display > them as if in an album, then you can use an ordinary inline with > the same template that the album would use, and I'll make sure the -> templates are set up so this works. -> +> templates are set up so this works. -s + +>> Still needs documenting, I've put it on the TODO list on the main +>> page. -s + > (Implementation detail: this means that an image X/Y/Z/W/V, where X and > Y are albums, Z does not exist and W exists but is not an album, > would have a content dependency on Y, a presence dependency on Z @@ -149,6 +177,12 @@ code or tried it yet, but here goes. --[[Joey]] > subpages of the album, although that would mean breaking some URLs > on the existing website I'm doing all this work for... -s +>> The current version of the branch doesn't have this restriction; +>> perhaps it's a worthwhile simplification, or perhaps it's too +>> restrictive? I fairly often use directory hierarchies like +>> `a_festival/saturday/foo.jpg` within an album, which makes +>> it very easy to write `albumsection` filters. -s + * Putting a few of the above thoughts together, my ideal album system seems to be one where I can just drop the images into a directory and have them appear in the album index, as well as each generate their own wiki @@ -156,7 +190,7 @@ code or tried it yet, but here goes. --[[Joey]] etc. (Real pity we can't just put arbitrary metadata into the images themselves.) This is almost pointing toward making the images first-class wiki page sources. Hey, it worked for po! :) But the metadata and editing - problems probably don't really allow that. + problems probably don't really allow that. -J > Putting a JPEG in the web form is not an option from my point of > view :-) but perhaps there could just be a "web-editable" flag supplied @@ -186,6 +220,10 @@ code or tried it yet, but here goes. --[[Joey]] >> upload-and-rename. >> -s +>>> I believe the current branch meets your requirements, by having +>>> first-class wiki pages spring into existence using `add_autofile` +>>> to be viewer pages for photos. -s + > In a way, what you really want for metadata is to have it in the album > page, so you can batch-edit the whole lot by editing one file (this > does mean that editing the album necessarily causes each of its viewers @@ -205,6 +243,9 @@ code or tried it yet, but here goes. --[[Joey]] >> (That's apparently good enough for Bugzilla, but not really >> for ikiwiki). -s +>>> This is now in the main page's TODO list; if/when I implement this, +>>> I intend to make it a specialized CGI interface. -s + >> Yes, [all metadata in one file] would make some sense.. It also allows putting one image in >> two albums, with different caption etc. (Maybe for different audiences.) >> --[[Joey]] @@ -220,7 +261,10 @@ code or tried it yet, but here goes. --[[Joey]] ---- -Trying to use the "special extension" design: +## alternative "special extension" design (conclusion: "don't") + +'''I think the "special extension" design is a dead-end, but here's what +happened when I tried to work out how it would work. --[[smcv]]''' Suppose that each viewer is a JPEG-or-GIF-or-something, with extension ".albumimage". We have a gallery "memes" with three images, badger, @@ -350,6 +394,10 @@ underlay, so that photos don't have to be in your source-code control > Replying to myself: perhaps best done as an orthogonal extension > to attach? -s +> Yet another non-obvious thing this design would need to do is to find +> some way to have each change to memes/badger._albummeta show up as a +> change to memes/badger in `recentchanges`. -s + Things that would be nice, and are probably possible: * make the "Edit page" link on viewers divert to album-specific CGI instead @@ -358,3 +406,193 @@ Things that would be nice, and are probably possible: * some way to deep-link to memes/badger.jpg with a wikilink, without knowing a priori that it's secretly a JPEG (probably harder than it looks - you'd have to make a directive for it and it's probably not worth it) + +---- + +## bug: unable to vary thumbnail size + +Hi smcv, great plugin. I am an ikiwiki newbie but so far I've had success using your plugin. +I've integrated the jquery masonry plugin into the albumitem template and it works great. +But is there a way to create thumnails of different sizes? I've passed thumnailsize option +and value to album directive and while it does create the new thumbnail sizes it doesn't use them, +The 96x96 thumbnails still appear on the page no matter what I do. - jaime + +> [[KathrynAndersen]] fixed this, see below. --[[smcv]] + +---- + +## failed installation + +Hi, the plugin looks great, but I am probably too dumb to use it ;( here is what I did: +created page gal.mdwn with just \[\[!album\]\] directive (no arguments) and subdirectory gal/ with images in form img_1234.jpg + +when I run ikiwiki, I get something completely wrong though: + +generated gal/index.html page contains following code repeated for every image: + +
+
+ +
+
+ +So no links to any images, etc. + +The pages for individual images are generated though, but also not correct. Trails section is perfect, but the main part is wrong: + +
+ â†<90>
+
+ + img 2913 +
+
+ +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! + +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) + +Any hint about what do I do wrong? + +Thanks Lukas + +> This plugin is not really finished. I probably need to update it for +> current ikiwiki. I'll try to update it (and also update my demo +> and installation instructions) at some point. --[[smcv]] + +>> I have to appologize, I accidentally copied the template wrongly and that caused all the issues ;( +>> So now after two days debugging and tracing, I just fixed that and it works. Well, at least a learnt +>> a lot about ikiwiki internal ;-) +>> Thanks for all the work you did on the plugin! --Lukas + +---- + +## bug + patch: not all images shown on album page + +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. + +--kjs + +> That sounds like a correct solution. I'll fix that in my branch when I work on +> this again. --[[smcv]] + +---- + +## bug: thumbnailsize doesn't work + +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. + +> [[KathrynAndersen]] fixed this, see below. --[[smcv]] + +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. + +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! + +--kjs + +---- + +## wishlist + patch: make clicking on the large image go to the next + +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` + +--kjs + +> That seems reasonable. I'll consider that when I work on this +> plugin again next. --[[smcv]] + +---- + +## wishlist from kjs + +My wishlist for the plugin would include: + +- Reading exif info from the imagefile +- ~~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. +- 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. +- 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. + +--kjs + +> I want the first two of those too, perhaps one day I'll get round to +> implementing them. +> +> For the third, you can get the same practical effect using an inline +> as documented in the main page. --[[smcv]] +>> 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 + +---- + +## suggested fix for thumbnail size bug + +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: + +
+*** /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') ||
+
+ +-- [[KathrynAndersen]] + +> I haven't tried this change, but it seems sane. I'll apply it +> when I next work on this plugin. +> +> (OOI: why not a unified diff? The VCS world seems to have +> settled on those as universal, and I find them easier to +> read.) +> +> --[[smcv]] + +---- + +## bug: inability to show more than 10 items + +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. + +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). + +-- [[KathrynAndersen]] + +> My intention was that all items would always be shown, so I would always pass +> `show => 0` to `preprocess_inline` (as kjs suggested above), but that must have +> got lost somewhere. I'll apply it next time I work on this plugin. +> +> An optional `show` parameter would be a possible enhancement beyond that, +> although I don't know how useful it would be; if it isn't passed, the +> default should be 0 (unlimited). --[[smcv]] + + +