diff src/image-load.c @ 1060:1e2de04c6fc4

added option to use exif thumbnails - it requires exiv2 0.18 or the current svn - it is disabled by default because the exif thumbnails may be outdated if the image was edited
author nadvornik
date Sat, 11 Oct 2008 20:19:48 +0000
parents 1646720364cf
children 9dd3522a0e23
line wrap: on
line diff
--- a/src/image-load.c	Tue Oct 07 19:34:11 2008 +0000
+++ b/src/image-load.c	Sat Oct 11 20:19:48 2008 +0000
@@ -607,12 +607,15 @@
 		{
 		ExifData *exif = exif_read_fd(il->fd);
 
-		il->mapped_file = exif_get_preview(exif, &il->bytes_total);
-		
+		if (options->thumbnails.use_exif)
+			il->mapped_file = exif_get_preview(exif, &il->bytes_total, il->requested_width, il->requested_height);
+		else
+			il->mapped_file = exif_get_preview(exif, &il->bytes_total, 0, 0); /* get the largest available preview image or NULL for normal images*/
+
 		if (il->mapped_file)
 			{
 			il->preview = TRUE;
-			DEBUG_1("Raw file %s contains embedded image", il->fd->path);
+			DEBUG_1("Usable reduced size (preview) image loaded from file %s", il->fd->path);
 			}
 		exif_free_fd(il->fd, exif);
 		}