mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
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.
This commit is contained in:
parent
8ffe4445f6
commit
5e3f448afb
1 changed files with 4 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue