Commit Graph

108 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 604594a8f1
Prepare for parallelized colour management
This rewrite is more or less necessary for:
 - colour-managed browser thumbnails,
 - asynchronous image loading,
 - turning fiv-io into a reusable library.

Little CMS has a fairly terrible API in this regard.
2024-01-28 01:48:28 +01:00
Přemysl Eric Janouch 3c8a280546
Move colour management to its own compilation unit
Also make it apparent that CMM profiles are pointer types.

This isn't all that pretty, but it's a necessary first step.
2024-01-26 19:17:54 +01:00
Přemysl Eric Janouch 96189b70b8
Mark places where lcms2 should use contexts 2024-01-26 17:25:04 +01:00
Přemysl Eric Janouch 84269b2ba2
Load AdobeRGB Nikon JPEGs correctly 2024-01-23 22:18:17 +01:00
Přemysl Eric Janouch c04c4063e4
Fix a class of animated transparent WebPs 2023-12-28 07:48:11 +01:00
Přemysl Eric Janouch aed6ae6b83
Add a comment regarding high-precision JPEGs 2023-12-05 04:57:01 +01:00
Přemysl Eric Janouch bae640a116
Circumvent JPEG QS & libjpeg-turbo incompatibility
UV upsampling visibly requires JPEG QS to update its code
to follow recent changes within libjpeg-turbo.
2023-12-05 03:35:33 +01:00
Přemysl Eric Janouch d4b91d6260
Fix double colour management in the librsvg loader 2023-07-13 08:04:41 +02:00
Přemysl Eric Janouch 840e7f172c
Colour-manage SVGs 2023-07-09 10:40:32 +02:00
Přemysl Eric Janouch 9b99de99bb
Fix crash in the librsvg loader 2023-07-09 04:39:35 +02:00
Přemysl Eric Janouch f05e66bfc1
Fix compatibility with newer resvg versions 2023-06-29 03:36:34 +02:00
Přemysl Eric Janouch 4249898497
Fix build without JPEG Quant Smooth 2023-06-27 22:40:29 +02:00
Přemysl Eric Janouch 1ef0a84bc7
Fix build with older versions of Cairo 2023-06-25 02:12:50 +02:00
Přemysl Eric Janouch bbfa2344d6
Fix colour management in animations
Bug introduced in d6e79cf.
2023-06-24 14:36:25 +02:00
Přemysl Eric Janouch bb4d3acd12
Premultiply through Little CMS in animations 2023-06-24 14:36:24 +02:00
Přemysl Eric Janouch 074bd4d37f
Stop abusing Cairo user data, part 2
With the shift from cairo_surface_t, we've lost our ability
to directly render vector surfaces, but it doesn't matter.
2023-06-24 14:36:24 +02:00
Přemysl Eric Janouch add96b37a6
Stop abusing Cairo user data, part 1
This commit temporarily breaks multi-page images and animations.
2023-06-24 13:56:36 +02:00
Přemysl Eric Janouch 4f57070e27
Fix 32-bit build warnings 2023-06-23 13:56:32 +02:00
Přemysl Eric Janouch 0318424540
Handle LibTIFF errors correctly 2023-06-13 13:49:30 +02:00
Přemysl Eric Janouch 8d5885bfdf
Prevent a possibility of GdkPixbuf crashes 2023-06-13 13:36:24 +02:00
Přemysl Eric Janouch 41b5ddc744
Fix thumbnailing with the GdkPixbuf loader 2023-06-13 13:21:03 +02:00
Přemysl Eric Janouch 7dda3bd1ed
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.
2023-06-08 12:17:43 +02:00
Přemysl Eric Janouch a3a5eb33cf
Unify non/enhanced JPEG loading code
And in so doing, add missing warning redirection to JPEG Quant Smooth,
as well as downscaling.

We still heavily depend on libjpeg-turbo.
2023-06-08 09:47:55 +02:00
Přemysl Eric Janouch ee202ca28b
Fix enhancement of CMYK JPEGs
The conversion to RGB was done twice.
2023-06-07 21:57:51 +02:00
Přemysl Eric Janouch 04db6ed6a1
Slightly clean up colour management
SVGs are now semi-managed.
2023-06-06 18:08:47 +02:00
Přemysl Eric Janouch d6e79cf976
With newer Little CMS, colour manage ARGB surfaces 2023-06-06 13:01:38 +02:00
Přemysl Eric Janouch 6cc4ca1f44
Use Little CMS's alpha premultiplication feature
And do a little cleanup.
2023-06-06 12:20:03 +02:00
Přemysl Eric Janouch 1c61fcc5bc
Move git submodules to a subdirectory 2023-06-04 12:57:47 +02:00
Přemysl Eric Janouch a710692725
Clean up namespace pollution 2023-05-28 10:13:04 +02:00
Přemysl Eric Janouch 859736e5be
Move FivIoModel to its own compilation unit 2023-05-28 09:33:03 +02:00
Přemysl Eric Janouch d5b2e43364
Clean up 2023-05-28 08:50:46 +02:00
Přemysl Eric Janouch 33251eaca7
Load MPF images as pages 2023-05-28 08:12:37 +02:00
Přemysl Eric Janouch 902eaf5a01
Make TIFF parsing a bit safer
At least on 64-bit systems, 32-bit may still have holes.
2023-05-28 08:12:22 +02:00
Přemysl Eric Janouch bb4b895cb5
Extract some full-size raw previews without LibRaw
Not all image/x-nikon-nef will work like this,
so don't claim their MIME type.
2023-05-26 15:32:34 +02:00
Přemysl Eric Janouch 0f1c61ae33
Extract all raw subimages as pages
And add missing colour management.
2023-05-26 13:30:22 +02:00
Přemysl Eric Janouch ac72a72afc
Mildly optimize raw image handling
Don't claim an alpha channel when we don't use it.
2023-05-21 22:56:29 +02:00
Přemysl Eric Janouch 44c28f00d6
Make supported media type listing output unique 2023-04-17 07:19:37 +02:00
Přemysl Eric Janouch 5e10f0ba54
Fix a logic error 2023-04-14 07:53:21 +02:00
Přemysl Eric Janouch eb44b6fb91
Fix a memory leak on image loading 2023-04-14 07:34:26 +02:00
Přemysl Eric Janouch a012011631
Deduplicate file information structures 2023-04-14 07:31:03 +02:00
Přemysl Eric Janouch 05ac3a0651
Check filesize when retrieving thumbnails
In particular, this handles screenshots from Rigol oscilloscopes,
which reuse the same name series with the same file modification time.
2023-04-14 05:24:57 +02:00
Přemysl Eric Janouch 1b50a834a5
Add optional browser filename labels 2023-04-11 06:04:27 +02:00
Přemysl Eric Janouch c646864805
Add directory tree traversal functionality
Thus far merely bound to the [ and ] keys in the browser.
2023-04-05 00:09:53 +02:00
Přemysl Eric Janouch 796b05c9a5
Integrate online reverse image search
This makes use of our image processing capabilities in order to
turn arbitrary image files into normalized thumbnails,
upload them to a temporary host, and pass the resulting URI
to a search provider.

In future, fiv should ideally run the upload itself,
so that its status and any errors are obvious to the user,
as well as to get rid of the script's dependency on jq.
2023-03-15 05:52:32 +01:00
Přemysl Eric Janouch 9286858573
Bump Wuffs 2023-03-07 20:26:04 +01:00
Přemysl Eric Janouch 62d82f38c8
Fix LibRaw 0.21.0 build 2022-12-23 17:17:33 +01:00
Přemysl Eric Janouch c063d93dc7
Fix LibRaw 0.21.0 build 2022-12-23 17:04:15 +01:00
Přemysl Eric Janouch 701846ab39
Support opening collections of files
Implement a process-local VFS to enable grouping together arbitrary
URIs passed via program arguments, DnD, or the file open dialog.

This VFS contains FivCollectionFile objects, which act as "simple"
proxies over arbitrary GFiles.  Their true URIs may be retrieved
through the "standard::target-uri" attribute, in a similar way to
GVfs's "recent" and "trash" backends.

(The main reason we proxy rather than just hackishly return foreign
GFiles from the VFS is that loading them would switch the current
directory, and break iteration as a result.

We could also keep the collection outside of GVfs, but that would
result in considerable special-casing, and the author wouldn't gain
intimate knowledge of GIO.)

There is no perceived need to keep old collections when opening
new ones, so we simply change and reload the contents when needed.

Similarly, there is no intention to make the VFS writeable.

The process-locality of this and other URI schemes has proven to be
rather annoying when passing files to other applications,
however most of the resulting complexity appears to be essential
rather than accidental.

Note that the GTK+ file chooser widget is retarded, and doesn't
recognize URIs that lack the authority part in the location bar.
2022-08-08 18:06:50 +02:00
Přemysl Eric Janouch 4927c8c692
Don't crash on orphan URIs 2022-08-08 15:14:20 +02:00
Přemysl Eric Janouch e7c75f8f9b
Remove forgotten include directive 2022-07-20 17:51:00 +02:00