Procházet zdrojové kódy

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.
Sebastian Krzyszkowiak před 3 roky
rodič
revize
35b212b11e
1 změnil soubory, kde provedl 5 přidání a 4 odebrání
  1. 5 4
      src/process_pipeline.c

+ 5 - 4
src/process_pipeline.c

@@ -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);