Picture handling: switch to stronger typed offset

Also change the on file XML to be even easier to read by making it a
duration as well (which gets us '32:34 min' instead of un-typed seconds).
This is backwards compatible, it will happily read what was written with
the previous commit).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-09 09:38:50 -07:00
parent b0983d9d13
commit a26719c541
5 changed files with 9 additions and 9 deletions

View file

@ -333,8 +333,8 @@ static void save_picture(struct membuffer *b, struct picture *pic)
put_string(b, " <picture filename='");
put_string(b, pic->filename);
put_string(b, "'");
if (pic->offset)
put_format(b, " offset='%d'", pic->offset);
if (pic->offset.seconds)
put_format(b, " offset='%u:%02u min'", FRACTION(pic->offset.seconds, 60));
if (pic->latitude.udeg || pic->longitude.udeg) {
put_degrees(b, pic->latitude, " gps='", " ");
put_degrees(b, pic->longitude, "", "'");