GNOME Bugzilla – Bug 150222
Comment format in web export is ugly
Last modified: 2006-11-05 22:11:34 UTC
When one creates a web album, the format gthumb uses for image comments is kind of ugly and run together. There is, in my opinion, insufficient whitespace between the comment, place, and date for clarity. Proposed fix: instead of encoding image comments as a string with <BR>s separating the comment, place, and date, use an HTML table with comment, place and date on separate rows. Patch to follow.
Created attachment 30573 [details] [review] Patch for issue described in bug 150222 Here's my fix: - I added two additional params to comment_get_comment_as_string(), to provide a head and tail to the returned string, as well as the two separators. These two new params can be null. - In all functions that call comment_get_comment_as_string() except in catalog_web_exporter.c, I added the two new NULL parameters. Thus, the results of this call are unaffected in these locations. In catalog_web_exporter.c (which is responsible for generating web albums), I replaced the " <BR>" separators with the necessary head, separator, and tail HTML code for a simple table with three rows. I discovered one side effect of this change: Since the comments are now in a separate sub-table in all the web album templates (image.ghtml), the <font> tags preceeding the comment insertion have no effect. As a work-around, I added the appropriate color code to the style sheet for <td> tags in image.ghtml for all web album templates in the distribution. This did not affect the color of any other text generated by the templates that I could find; the template author was very careful to put <font> tags whereever they might be needed. The net result is that the comment format in web albums is a little prettier. I didn't touch the changelog, because I don't know how you guys handle those things.
Created attachment 35310 [details] [review] Patch to modify HTML output, against CVS tree 20041216 With this patch, in exported HTML, comments are nested in a <div> block, with each section (label, location, date) nested in a <p> element. Each block has a class name assigned to it, so that their appearance can be manipulated from within web export template files via CSS. The new HTML code is valid under XHTML 1.1, so it should not cause any portability issues in the future. The main differences from the old version are that the old version embedded the comment information inside a table, which is considered poor HTML design, and didn't have the class tags to make CSS modification easy.
Rennie, Could you update your patch against CVS HEAD? - Mike
I generalized this bug into a much larger set of modifications to the web export language last fall, detailed in bug 319933, which was ignored by the gthumb maintainers at the time. Those changes allowed me to generate much more elaborate web albums like this (http://pages.cpsc.ucalgary.ca/~degraaf/Photos/aurora_borealis/), using a new DHTML template that I wrote (http://pages.cpsc.ucalgary.ca/~degraaf/software/gthumb/BestFit.tgz). If you're interested in this larger patch, then I'll mark this bug as a dupe and try to update that one; otherwise, I should be able to update this patch fairly quickly. By the way, thanks for going back through these old bugs. I was pretty annoyed at being ignored when I first submitted them. Rennie
Rennie, OK, please update bug 319933 for review. I was starting with the simpler patches (because I have to understand everything that I commit) but there's no point committing this if you have a better patch. Do you think you can slip in iso-coding of non-ascii characters into your patch, to address bug 155042? I also have my eye on Bug 166579 – Improvements to file and comment labels on Web Album creation. Please keep that bug in mind when updating yours - perhaps you've already added the same functionality; I haven't checked yet. Keep the patches compatible anyway, and add a note there if you do anything that affects it. A sample theme that used your modifications should probably be attached to bug 319933, to simplify testing. It's a tragedy to ignore the effort put into patches... it defeats the spirit of gnome. So this is my way of helping, even if I'm not an ace programmer! - Mike *** This bug has been marked as a duplicate of 319933 ***