Commit 5e3f448a authored by Stefan Kost's avatar Stefan Kost
Browse files

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.
parent 8ffe4445
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment