]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/contrib/img/discussion.mdwn
Change Projects link to point to projects DB
[ikiwiki.git] / doc / plugins / contrib / img / discussion.mdwn
1 This is a good idea, I was just the other day stuck writing ugly html to
2 properly size an image for a blog post. Putting the image sizing support
3 into a plugin instead of trying to shoehorn it into a wikilink seems like
4 the way to go.
5
6 I have two issues with this plugin as it's implemented now, the first is
7 that the generation of whole pages containing a scaled version of the image
8 seems gratuituous, as well as buggy. If you want three pages with
9 differently scaled versions of the image, why not just create three pages
10 and use the plugin once per page? Something like this on the first one if
11 it's got multiple clickable thumbnails:
12
13         \[[!img foo.jpg width=256 link=page2]]
14
15 This on the second:
16
17         \[[!img foo.jpg width=1024 link=page3]]
18         \[[small|page1]]
19         \[[medium|page2]]
20         \[[large|page3]]
21
22 This on the third:
23         
24         \[[!img foo.jpg link=page3]]
25         \[[small|page1]]
26         \[[medium|page2]]
27         \[[large|parge3]]
28
29 Granted, this is more work, but it's more flexible too, and it doesn't have
30 it creating new pages on the fly, which I don't personally like..
31
32 ----
33
34 The second issue is whether it should use imagemagick to scale the image
35 and generate a new scaled one, or just emit html that sets the sizes of the
36 image. Benefits to scaling:
37
38 1. Saves download time and bandwidth, especially if generating a page with a
39    lot of thumbnails of large images.
40
41 Benefits of not scaling:
42
43 1. Avoids any security issues with imagemagick.
44 2. Avoids issue of how to clean up old scaled images that are no longer being
45    used. (Granted, this is a general ikiwiki problem that will eventually
46    be fixed in a general way. (Update: now fixed in a general way, use the
47    will_render function.))
48 3. Makes clicking on thumbnails display the full version really fast, since
49    it's cached. :-)
50
51 --[[Joey]]