Commit Graph

94 Commits

Author SHA1 Message Date
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
Přemysl Eric Janouch a9a9d69a92
Add missing array sentinel value 2022-07-19 16:08:53 +02:00
Přemysl Eric Janouch 07aa11d78d
Use GPatternSpec rather than fnmatch()
Fixing a portability issue on Windows, where we still aim to use
the shared-mime-info database.
2022-07-14 10:08:15 +02:00
Přemysl Eric Janouch 930744e165
Add flags to the serialization protocol
It still needs no versioning, as it's not really used by anyone.

An alternative method of passing a "low-quality" flag would be
perusing fiv_thumbnail_key_lq from fiv-thumbnail.c, which would
create a circular dependency, unless fiv_io_{de,}serialize*()
were moved to fiv-thumbnail.c.
2022-06-08 02:51:54 +02:00
Přemysl Eric Janouch 4ca8825e02
Clean up
Use gchar when memory is allocated through GLib.
2022-06-05 13:30:53 +02:00
Přemysl Eric Janouch 024b5117b4
Get rid of our spng dependency
Thumbnails can be properly loaded using Wuffs now.
2022-06-04 23:14:15 +02:00
Přemysl Eric Janouch ac6b606ccc
Bump Wuffs, support partial PNGs through it 2022-06-04 19:19:16 +02:00
Přemysl Eric Janouch 3ddb0cf205
Expose the mtime of the model's entries 2022-06-04 14:50:56 +02:00
Přemysl Eric Janouch efc13db66e
Plug two memory leaks 2022-06-04 01:28:44 +02:00
Přemysl Eric Janouch 5c34a6846a
Fix loading huge JPEGs
They fell back to gdk-pixbuf, then misrendered in the thumbnailer,
and crashed the program when loaded directly.

The second best we can do is scale them down, right after tiling,
which is a complex feature to add.
2022-03-09 18:04:36 +01:00
Přemysl Eric Janouch 04ec292caf
Make thumbnailers pass back raw images 2022-02-20 21:14:33 +01:00
Přemysl Eric Janouch 6c748439ed
Use natural sort order
This is exposed in GLib through collate key construction.
2022-02-20 12:07:41 +01:00
Přemysl Eric Janouch 3ae8be8348
Add a TODO comment
WebP can't save all JPEGs, because WEBP_MAX_DIMENSION is only 16383.
2022-02-18 19:54:05 +01:00
Přemysl Eric Janouch 03d1798e23
Add a missing header file include 2022-02-14 06:55:37 +01:00
Přemysl Eric Janouch 381e5f57c7
Add TGA to the list of supported media types 2022-01-25 05:16:31 +01:00