|
The code assumes that the images have already been processed to provide thumbnails from originals and that the originals are in the right size.
Looking at the JAlbum code, a lot of image manipulation functionality is provided. So in an ideal situation, the XSL takes the images from the dir (as it does now), but then creates thumbnails and slide pictures according to specified attributes. What is the best way for me to implement this functionality in forrest? Is using Java methods frowned upon with forrest? Any hints would be good to implement the following: 1. the xml file will point at a dir with original images 2. attributes will specify slide size and thumbnail size and these will be generated during a build 3. then the html/pdf is created using the skin Does that make sense, any other wishes and suggested implementation routes are most appriciated. See FOR-296 for a link to a discussion involving image resizing. I don't think the discussion goes in to how the image gets resized, just how we would control the resizing. I'm sure Cocoon has some way to do this...
Complete and working plugin (Thanks to Jorg Werner)
From a mail by Jorg Werner (plugin Author):
okay, you got me hooked up. I found some more time to hack on the gallery plugin. It is now in a working state. You can download the plugin from http://bodensee.pi5.physik.uni-stuttgart.de/~joerg/org.apache.forrest.plugin.gallery.zip . The pictures are expected unter {project:content.xdocs}/gallery/** in the folders preview, small, big. Since the gallery plugin uses request parameters, it will only work as a webapp. On a related note (see don't think that it does make sense to generate the necessary image files on the fly. This costs a lot of processor cycles. Think about the overview page. Scaling 20 pictures from a 5MP-Digikam to preview size takes around 15s, and this for each page request. Scales computationally really great (but caching would help...). The only other option I see is that in forrest run, the preview and small pictures are generated before the webapp is started. But I don't think cocoon has the ability to scale pictures built in (havn't found something in the docs...). Right now I use a short bash script to do the conversion a la: #!/bin/bash for i; do echo -n "Converting:" $i "... "; convert -size 100x100 $i -resize 100x100 preview/$i; convert -size 400x400 $i -resize 100x100 small/$i; convert -size 800x800 $i -resize 100x100 big/$i; echo "done."; done It is sufficient for my purposes. Todo for the plugin: -requesting http://localhost/gallery/lena/ without index.html is not yet matched (I had a fix for this, but I cant remember what it was...) -I tried to align the left- and right arrows vertically in the table (using valign="middle") but this didn't work. Maybe some of the html gurus can fix this. -what is the required syntax for links and images <a> and <img> or <link> and <figure>, document-v20.dtd seems to allow both? -I haven't tried other image types than jpg. Maybe there is still some hidden code which assumes this. Can someone test this? -Implement the comment.xml feature (how can I merge the xml from the imagedirectory-generator and the comment.xml) -Implement tool-tip infos -Implement reading of exif data in cocoon imagedirectory-generator -Implement a template facility for the picture page (so you can change the layout, right now everything is hardcoded in gallerypicture.xsl). This would require again merging of two xml sources... But since I really don't have time for this, I leave these exercises to the reader (I really hate this sentence in textbooks, but it is fun to use it in his own texts ;-) ) Cheers, Jörg -- Dipl.-Phys. Jörg Werner j.werner@physik.uni-stuttgart.de Universität Stuttgart 5. Physikalisches Institut Telefon: 0711/685-5195 Pfaffenwaldring 57 Telefax: 0711/685-3810 D-70550 Stuttgart Visit our Homepage: http://www.physik.uni-stuttgart.de/institute/pi/5/index.html My private Homepage: http://schreibubi.pi5.physik.uni-stuttgart.de/ GPG-Key fingerprint: FDD9 7AAF BD31 1F3C FD9D 7D34 C00A 22BB C0AF DFB2 There were a few problems with this code so committed with some changes (functionlaity remains the same). Most notably:
- Changed method of identifying pictures, it no longer users request parameters, therefore it will work in a statically generated site as well as in a webapp. - removed output.xmap since a plugin cannot provide input.xmap *and* output.xmap. functionlaity in output.xmap moved to resources.xmap - enabled display of full size image - Added some sample pictures for docs - Added basic documentation. > I tried to align the left- and right arrows vertically in the table > (using valign="middle") but this didn't work. Maybe some of the html > gurus can fix this main\webapp\skins\pelt\css\basic.css: #content th, #content td { margin: 0; padding: 0; /*vertical-align: top;*/ } Forces vertical-align from the skin, commenting it out works ok? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
>>Do whatever you want with code, I thereby license it under the
>>> > BSD-License.
>
>>
>> I missed this line on the first reading. The BSD license is compatible
>> with the Apache license so we can still use your code. However, if we
>> want to host it as a plugin here it will need to be ASF2 licensed.
Okay, so I hereby state that the code is dual licensed under BSD and ASF2.
It would be really great to see the plugin hosted at apache.org. I really like
the forrest project so I think it is time to give something back...