From: Stefan Kost Date: Wed, 25 May 2011 11:12:50 +0000 (+0300) Subject: exiftag: reflow the code X-Git-Tag: 1.19.3~511^2~6555^2~861 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e3f448afb33322f3518252b46ff5d3845b2fa8d;p=platform%2Fupstream%2Fgstreamer.git exiftag: reflow the code Move the warning on unsupported units to the swicth-case. Move fetching the pending tags down to where we use them. --- diff --git a/gst-libs/gst/tag/gstexiftag.c b/gst-libs/gst/tag/gstexiftag.c index 9d941da..2527e99 100644 --- a/gst-libs/gst/tag/gstexiftag.c +++ b/gst-libs/gst/tag/gstexiftag.c @@ -2565,14 +2565,6 @@ deserialize_resolution (GstExifReader * exif_reader, unit = GST_READ_UINT16_BE (tagdata->offset_as_data); } - if (unit != 2 && unit != 3) { - GST_WARNING ("Invalid resolution unit, ignoring PPI tags"); - return 0; - } - - xres = gst_exif_reader_get_pending_tag (exif_reader, EXIF_TAG_XRESOLUTION); - yres = gst_exif_reader_get_pending_tag (exif_reader, EXIF_TAG_YRESOLUTION); - switch (unit) { case 2: /* inch */ multiplier = 1; @@ -2581,15 +2573,16 @@ deserialize_resolution (GstExifReader * exif_reader, multiplier = 1 / 2.54; break; default: - multiplier = 1; - g_assert_not_reached (); - break; + GST_WARNING ("Invalid resolution unit, ignoring PPI tags"); + return 0; } + xres = gst_exif_reader_get_pending_tag (exif_reader, EXIF_TAG_XRESOLUTION); if (xres) { parse_exif_rational_tag (exif_reader, GST_TAG_IMAGE_HORIZONTAL_PPI, xres->count, xres->offset, multiplier, FALSE); } + yres = gst_exif_reader_get_pending_tag (exif_reader, EXIF_TAG_YRESOLUTION); if (yres) { parse_exif_rational_tag (exif_reader, GST_TAG_IMAGE_VERTICAL_PPI, yres->count, yres->offset, multiplier, FALSE);