process_pipeline: Don't store unspecified ISO values in metadata

When the camera config does not specify ISO range, all we get there
is garbage.
This commit is contained in:
Sebastian Krzyszkowiak 2021-06-20 13:34:02 +02:00 committed by Martijn Braam
parent 363a1a0c39
commit d6df1458fc
No known key found for this signature in database
GPG Key ID: C4280ACB000B060F
1 changed files with 5 additions and 4 deletions

View File

@ -457,10 +457,11 @@ process_image_for_capture(const uint8_t *image, int count)
(mode.frame_interval.numerator /
(float)mode.frame_interval.denominator) /
((float)mode.height / (float)exposure));
uint16_t isospeed[1];
isospeed[0] = (uint16_t)remap(gain - 1, 0, gain_max, camera->iso_min,
camera->iso_max);
TIFFSetField(tif, EXIFTAG_ISOSPEEDRATINGS, 1, isospeed);
if (camera->iso_min && camera->iso_max) {
uint16_t isospeed = remap(gain - 1, 0, gain_max, camera->iso_min,
camera->iso_max);
TIFFSetField(tif, EXIFTAG_ISOSPEEDRATINGS, 1, &isospeed);
}
TIFFSetField(tif, EXIFTAG_FLASH, 0);
TIFFSetField(tif, EXIFTAG_DATETIMEORIGINAL, datetime);