summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Riemann <friemann@svn.gnome.org>2007-02-07 17:35:34 +0000
committerFelix Riemann <friemann@src.gnome.org>2007-02-07 17:35:34 +0000
commit83438466efd4e10cb7a0dfe18168add39aeff17f (patch)
tree1928bc30fdae2585b69b8214aee2b0784dc4b26e
parent3ce519358bd663561b5915f7d743e2ae5b720966 (diff)
downloadeog-83438466efd4e10cb7a0dfe18168add39aeff17f.tar.gz
According to the EXIF specs Pixel{X,Y}Dimension tags can be either of
2007-02-07 Felix Riemann <friemann@svn.gnome.org> * libeog/eog-image.c: (update_exif_data): According to the EXIF specs Pixel{X,Y}Dimension tags can be either of short or long datatype. Respect that. This fixes warnings in Valgrind and wrong values in images using the short type. svn path=/trunk/; revision=3532
-rw-r--r--ChangeLog7
-rw-r--r--libeog/eog-image.c14
2 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f4d28ebd..9af6409f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-07 Felix Riemann <friemann@svn.gnome.org>
+
+ * libeog/eog-image.c: (update_exif_data): According to the EXIF specs
+ Pixel{X,Y}Dimension tags can be either of short or long datatype.
+ Respect that. This fixes warnings in Valgrind and wrong values in
+ images using the short type.
+
2007-02-03 Felix Riemann <friemann@svn.gnome.org>
* libeog/eog-image-list.c: (eog_image_list_add_uris): Fix leak.
diff --git a/libeog/eog-image.c b/libeog/eog-image.c
index 62892890..928eb735 100644
--- a/libeog/eog-image.c
+++ b/libeog/eog-image.c
@@ -355,12 +355,22 @@ update_exif_data (EogImage *image)
entry = exif_content_get_entry (priv->exif->ifd [EXIF_IFD_EXIF], EXIF_TAG_PIXEL_X_DIMENSION);
if (entry != NULL && (priv->width >= 0)) {
- exif_set_long (entry->data, bo, priv->width);
+ if (entry->format == EXIF_FORMAT_LONG)
+ exif_set_long (entry->data, bo, priv->width);
+ else if (entry->format == EXIF_FORMAT_SHORT)
+ exif_set_short (entry->data, bo, priv->width);
+ else
+ g_warning ("Exif entry has unsupported size");
}
entry = exif_content_get_entry (priv->exif->ifd [EXIF_IFD_EXIF], EXIF_TAG_PIXEL_Y_DIMENSION);
if (entry != NULL && (priv->height >= 0)) {
- exif_set_long (entry->data, bo, priv->height);
+ if (entry->format == EXIF_FORMAT_LONG)
+ exif_set_long (entry->data, bo, priv->height);
+ else if (entry->format == EXIF_FORMAT_SHORT)
+ exif_set_short (entry->data, bo, priv->height);
+ else
+ g_warning ("Exif entry has unsupported size");
}
}
#endif