diff options
| author | Přemysl Eric Janouch <p@janouch.name> | 2023-06-08 12:16:17 +0200 | 
|---|---|---|
| committer | Přemysl Eric Janouch <p@janouch.name> | 2023-06-08 12:17:43 +0200 | 
| commit | 7dda3bd1ed923e9c2dba887670b9f65509235375 (patch) | |
| tree | 790424edab48c6824dbbc738cf61f0a2d741e8a0 /fiv-io.c | |
| parent | a3a5eb33cf1be810eb3821c913bfd2d8b964336a (diff) | |
| download | fiv-7dda3bd1ed923e9c2dba887670b9f65509235375.tar.gz fiv-7dda3bd1ed923e9c2dba887670b9f65509235375.tar.xz fiv-7dda3bd1ed923e9c2dba887670b9f65509235375.zip  | |
Make it possible to switch off our TIFF/EP loader
Slightly repurpose the "enhance" toggle, which doesn't particularly
make sense to run on a thumbnail.
Diffstat (limited to 'fiv-io.c')
| -rw-r--r-- | fiv-io.c | 19 | 
1 files changed, 13 insertions, 6 deletions
@@ -1880,13 +1880,16 @@ fail:  // typically contain a nearly full-size JPEG preview.  //  // LibRaw takes too long a time to render something that will never be as good -// as the large preview, and libtiff can only read the horrible IFD0 thumbnail. +// as that large preview--e.g., due to exposure correction or denoising. +// While since version 0.21.0 the library provides an API that would allow us +// to extract the JPEG, a little bit of custom processing won't hurt either. +// TODO(p): Though it can also extract thumbnails from many more formats, +// so maybe keep this code as a fallback for old or missing LibRaw. +// +// Note that libtiff can only read the horrible IFD0 thumbnail.  // (TIFFSetSubDirectory() requires an ImageLength tag that's missing from JPEG  // SubIFDs, and TIFFReadCustomDirectory() takes a privately defined struct that  // may not be omitted.) -// -// While LibRaw since 0.21.0 provides an API that would allow us to extract -// the JPEG, a little bit of custom processing won't hurt either.  static bool  tiffer_find(const struct tiffer *self, uint16_t tag, struct tiffer_entry *entry) @@ -3234,15 +3237,19 @@ fiv_io_open_from_data(  		surface = open_libwebp(data, len, ctx, error);  		break;  	default: -		// Try to extract full-size previews from TIFF/EP-compatible raws. +		// Try to extract full-size previews from TIFF/EP-compatible raws, +		// but allow for running the full render. +#ifdef HAVE_LIBRAW  // --------------------------------------------------------- +		if (!ctx->enhance) { +#endif  // HAVE_LIBRAW ---------------------------------------------------------  		if ((surface = open_tiff_ep(data, len, ctx, error)))  			break;  		if (error) {  			g_debug("%s", (*error)->message);  			g_clear_error(error);  		} -  #ifdef HAVE_LIBRAW  // --------------------------------------------------------- +		}  		if ((surface = open_libraw(data, len, ctx, error)))  			break;  | 
