Commit graph

305 commits

Author SHA1 Message Date
Sophie Herold
ae5ca76176 printing: Add printing support
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/165>
2023-04-18 23:52:53 +00:00
Sophie Herold
e96b9ccac9 image: More fine-grained zoom instructions
Add parameters to use zoom_to without animation or
snapping to best fit. Hopefully fixing 100%/200% snapping
to best fit when close to filling the window and
fixing high res scroll wheel bugs.

Closes #120, #134

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/177>
2023-04-18 23:23:18 +00:00
Sophie Herold
44e265374b image: Fix thumbnail for auto rotated images
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/175>
2023-04-18 22:35:19 +00:00
Sophie Herold
3684a9c02e image: Use lighter background for light theme
Closes #124

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/171>
2023-04-18 21:49:43 +00:00
Sophie Herold
8669b870af image: Fix textures and bg color not reloading
The reload procedure for changed image files is triggered
but the old data has to be deleted to be re-generated.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/176>
2023-04-18 21:03:02 +00:00
Sophie Herold
aca49427a1 window: Support dropping multiple files
This allows to scroll through all dropped files.
No further images from directories are loaded in
this mode.

Closes #35
2023-04-18 22:29:30 +02:00
Sophie Herold
e710419a22 decoder: Add basic color profile support
This only covers 8bit RGB(A) JPEG, PNG, and HEIF.
Should only be a temporary solution until GTK supports
color profiles.

Closes #36

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/172>
2023-04-18 21:22:09 +02:00
Sophie Herold
3264d7813d propertiesView: Use local datetime
Closes #130

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/166>
2023-04-18 18:32:21 +00:00
Sophie Herold
e8aa5451c3 decoder: Avoid unwraps and report issues to UI
Those are mostly cases that should never occur.
But especially for rare erros it can be helpful to
directly display them in the UI.
2023-04-18 17:57:41 +00:00
Sophie Herold
5a93ec71da image: Do not require monitor information
Before, monitor information not being available lead to panic.

Closes #77

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/167>
2023-04-18 17:08:35 +00:00
Sophie Herold
fad8bb7939 decoder: Use GFile instead of PathBuf
This allows to show images from locations that don't
have a representation with path.

This also works around not being able to read files in trash:///

Closes #56

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/174>
2023-04-18 16:22:49 +00:00
Sophie Herold
032707a210 fileModel: Use GFile with URI as key
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/174>
2023-04-18 16:22:49 +00:00
Sophie Herold
f8cc9f5f84 i18n: Use gettext function instead of wrapper
No need to deviate from the default here.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/170>
2023-04-12 12:58:40 +00:00
Sophie Herold
8b3cfd000a cargo: Remove gtk-macros dependency
Using the crate is depreacted. Replaced spawn! macro
with our own spawn function
2023-04-06 21:08:33 +00:00
Sophie Herold
ca672552be decoder: Bring back support for still WebP images
We manually have to use the static decoder instead of
the frames api as for PNG.

Issue #115
2023-04-06 21:08:23 +00:00
Sophie Herold
65e967c235 decoder: Detect HEIC/HEIF via guessed mime type
This will not cover files with wrong extensions. But
we don't have a magic byte sniffer in place yet.

Issue #115
2023-04-06 21:08:10 +00:00
Sophie Herold
1b18486826 image: Move background color guess to other thread
Also, skip it completely for JPEG and BMP

Issue #111
2023-04-04 22:13:36 +00:00
Sophie Herold
5d7cbe026f image: Remove debug prints from bg color guesser
Closes #111
2023-04-03 16:56:54 +02:00
Sophie Herold
7bf9baa581 image: Ensure contrast for transparent images
Determine if the image is transparent and has low
contrast with default background color. If so,
use a different background color.

Closes #31

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/151>
2023-04-02 23:08:51 +00:00
Sophie Herold
533158bb69 image: Request tiles on size_allocate
Fixes tiles for SVG might be missing when enlarging window.

Closes #104

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/155>
2023-04-02 21:36:24 +00:00
Christopher Davis
2965799374 general: Remove help-related code
Our help documents are unfinished, and we shouldn't ship
unfinished documentation in our initial release.

We can revert this commit when we're ready to write the
documents properly.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/156>
2023-04-02 18:36:17 +00:00
Sophie Herold
750fbfd305 image: Settle with either rotate or zoom gesture
Add thresholds after which the gesture is assumed to be
only zoom or rotate.

Closes #95, #29

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/145>
2023-04-02 16:47:57 +00:00
Sophie Herold
7b7ece1dc3 slidingView: Allocate LpImage more correctly
Allocate the ScrolledWindow instead of the LpImage
to include non-overlayed scrollbars.

General cleanup how we measure things.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/150>
2023-04-02 15:42:42 +00:00
Sophie Herold
e5fc4bc85c image: Add high DPI support
Always interpret the scaling percentag in physical pixels.
This makes 100% show the image 1:1 in screen pixels.

Closes #37
2023-04-02 15:22:12 +00:00
Sophie Herold
67207bb215 image: Use mipmaps for zoom-out and NN for zoom-in
Before we always used "linear" filtering. This gave
a harsh image with moire patterns when zooming out
and washed out images when zooming in.

Closes #68, #71

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/125>
2023-03-25 15:32:31 +00:00
Sophie Herold
7bcc5e210b cargo: Update and cleanup dependencies
- Replace one remaining use of util::spawn with gio
- Replace pretty_env_logger with env_logger

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/149>
2023-03-25 14:01:28 +00:00
Sophie Herold
0e24f347e6 imagePage: Move popover out of LpImage
It cause 'not measured' errors and we have enough
things to handle in LpImage already.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/146>
2023-03-18 21:24:45 +00:00
Sophie Herold
f33c4bd470 decoder: Support animated formats (GIF, WEBP, APNG)
Closes #27
2023-03-18 20:23:08 +00:00
Sophie Herold
889c818c14 code: Use pub(super) in GObject impl structs
This helps with getting warnings for fields we no longer use

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/143>
2023-03-14 21:25:45 +00:00
Sophie Herold
138ab4ffd9 docs: Add widget overview
Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/142>
2023-03-14 16:51:48 +00:00
Sophie Herold
e93020d9ab propertiesView: Unify localized DateTime format
Closes #43

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/141>
2023-03-14 03:50:22 +00:00
Sophie Herold
b8d5f833f3 decoder: Cleanup and better image format detection
Closes #97

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/140>
2023-03-14 03:59:21 +01:00
Sophie Herold
42d558d22f propertiesView: Use image dimensions from decoder
This also shows the units for SVG dimensions if not pixels.

Issue #43

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/136>
2023-03-14 02:31:07 +00:00
Sophie Herold
a2a9b4134b propertiesView: Use decoder format
Use the format that we actually used when decoding.
The mime type is usually derived from the file extension
which might not always be correct.

Issue #43

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/132>
2023-03-14 00:50:40 +00:00
Sophie Herold
f8e64d9805 trash: Use non-existing name when restoring image
We usually use the original path of the image.
For the rare case the original file name exists we create
one that is not used yet.

Closes #66

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/130>
2023-03-14 00:07:08 +00:00
Sophie Herold
ddf4b8c2fa decoder: Load HEIC/x265 as plugin
Closes #85

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/123>
2023-03-13 23:12:07 +00:00
Sabri Ünal
e0876ef6d3 application: Update copyright years
Just update copyright years.
2023-03-11 00:49:03 +00:00
Sophie Herold
a0ce234946 image: Limit SVG zoom to RSVG limits
See <https://gitlab.gnome.org/GNOME/librsvg/-/issues/938>
for details about the problem.

Closes #88
2023-03-11 00:06:51 +00:00
Christopher Davis
dfebfb7470 application: Update about window
* Use team name instead of just my name
* Don't use `vec!` macro
* Add translator-credits

Closes https://gitlab.gnome.org/Incubator/loupe/-/issues/98
2023-03-10 18:31:02 -05:00
Sophie Herold
074b6b54e7 code: Fix new clippy hint 2023-03-10 19:17:22 +01:00
Sophie Herold
9b532f93f3 propertiesView: Use strong file reference
This fixes issues with file info not loading.

Closes #96
2023-03-09 23:46:04 +01:00
Sophie Herold
5217d39cd3 tiling: Revert using append_scaled_texture
It slows down zoom and pan and has no use yet.
2023-03-08 03:00:26 +00:00
Sophie Herold
6a4ee11c76 imageView: Add only viewed images to recently used
Only adding images expclicitly opened via file browser
or drag and drop. Do not add images while browsing
SlidingView to avoid spamming recently used files.

Closes #53
2023-03-08 02:24:27 +00:00
Sophie Herold
05ef429b86 image: Add newly designed thumbnail for DnD
The old method stopped working with the new decoder setup.

The new design features a frame for contrast and rotates
images based on EXIF information.

Closes #89
2023-03-08 01:48:34 +00:00
Sophie Herold
f12ff1ea4d widgets: Add some widget descriptions 2023-03-06 22:59:40 +01:00
Sophie Herold
f80ec7db56 decoder: Use image-rs, libheif-rs, librsvg
This adds proper support for a lot of image formats including SVGs.
It will be the basis for many features to come. The technical core
is an asynchronous renderer that can arrange textures in smaller tiles
which might be generated on demand.

Closes #34, #40, #41, #49

Basis for fixing the following issues #7, #27, #36, #43, #68, #71
2023-03-04 21:48:51 -05:00
Christopher Davis
4d4bc4bb38 application: Stop using expressions
This commit moves the logic from the expressions to the
window via GSignalGroup.
2023-03-05 02:13:41 +00:00
Christopher Davis
3d445f25fe window: Use GSignalGroup to watch zoom levels
This allows us to git rid of more expression code.
2023-03-05 02:13:41 +00:00
Christopher Davis
aab50af31a image_view: Switch from expressions to signal groups
Expressions have the leak issue mentioned in the previous
commit, but we were using them in a few scenarios where
they couldn't be used in UI files.

Since these expressions don't set a property but instead
trigger behavior, the appropriate API to use is GSignalGroup.
This commit switches the expressions on the image to use
GSignalGroup instead.
2023-03-05 02:13:41 +00:00
Christopher Davis
ae41a77521 properties_view: Move expressions to UI files
Currently Loupe leaks expressions created in-code. This
is because expressions need to be unwatched in order to be
dropped. Since we'd need to hold a reference to the watch
ourselves and unwatch them in dispose, our code would
become more cumbersome if we were to try to handle this properly.

This commit moves the expressions on LpPropertiesView to the
UI file, as GTK handles cleaning up the expressions it creates,
without any extra consideration on the app side.
2023-03-05 02:13:41 +00:00