[Bins] Buglet: Regeneration of album images when XML file changed

Jérôme SAUTRET jerome at sautret.org
Sun May 4 20:12:49 BST 2003

On Mon, Apr 28, 2003 at 11:39:05PM +0200, Matthias Hanisch wrote:
> I just wanted to let you know about a slight problem with the regeneration of 
> the album images.
> For better explanantion, I would like to describe the steps to face this 
> behavior:
> 1. Generate the album as usual with bins <srcdir> <albumdir>
> 2. After looking at the album, discover, that one image has to be rotated.
> 3. Call bins-edit-gui on the image, rotate left and save.
> 4. Regenerate the album, the image is not generated again, and stays with the 
> wrong orientation.

Yes, this is stated in the header comment of the /etc/bins/binsrc
file : you have to "touch" the image if you modify some parameters
like orientation, previewMaxHeight, previewMaxWidth or jpegQuality. I
will add a note about this in the HTML documentation too.
> I'm not a Perl programmer at all, but after some quick look on the code, I 
> would suggest to introduce an additional test in subfunction 
> writeScaledVersion(), something like:
> "If the corresponding XML file is newer than the generated album image, then 
> do a regeneration, too, because it could contain orientation changes."

I'm not sure that regenerating images when a description field is
modified is optimal. Imagine one change the event or place fields of
an entire album using bins_edit *.jpg, all the album will be
regenerated, which is not needed. Perhaps a better solution is that
bins-edi-gui "touch" the image after changing the orientation field.

> I also implemented a fix, it works, but is too ugly to publish (see above for 
> the reason :). The additional if condition is straightforward. Neverless, I 
> can make it available on request. You have been warned.

At least this can be added but controlled by an option, so that people
that find it useful can activate it.

Jérôme SAUTRET (Jerome at SAUTRET.org)           http://SAUTRET.org
Key 0x95D463F3 fingerprint 3B69 3B60 4D32 B8DF 2BF3 8035 5036 D41A 95D4 63F3

More information about the Bins mailing list