Repository navigation
Conversation
Keep the crop producer's 8-bit RGBA contract for 16-bit images, correct its dimensions after identify, clean up its socket and state, and write fit state when the toggle is turned off. Queue filter changes that arrive during an in-flight request instead of dropping them, and avoid sending unsupported ratios to the Wallhaven API. Also reject malformed wallpaper IDs before they reach cache paths, apply fitted crops to the focused output, stop the helper on exit even during an apply, and render crops to a cache temp file before moving them into place. Sweep partial downloads, crop temp files, and stale helper files at panel open, document the runtime requirements, socket policy, reads, and writes, and use the existing mode label as the resolution select placeholder. Prefer ImageMagick 7's `magick` and fall back to ImageMagick 6's `convert`/`identify`. The helper writes a PID file so the panel can replace a crashed helper instead of trusting a stale socket. Regenerate the thumbnail with the official generator layout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Fit toggle to the Wallhaven preview. With Fit on, the preview shows the full image with a highlighted, draggable monitor-aspect box; Apply crops that region, scales it to the focused monitor's resolution, and applies it to that output. With Fit off, preview and Apply keep the existing full-image behavior.
Also adds monitor-aware filters: Mine resolution and aspect ratio use the focused output, At Least Mine filters for resolutions at least as large as the monitor, and random sorting gets a shuffle icon.
Motivation
Wallhaven images are often much larger than the monitor, and the existing preview only offered a full-image Apply. Picking the visible part required an external image editor. Fit keeps the choice inside the panel and guarantees the saved file matches the monitor resolution instead of relying on the compositor to crop an oversized image.
Type of Change
Related Issue
None.
Testing
validate-plugins.py --profile official→Validated 14 plugin manifest(s).test_validate_plugins.py→Ran 178 tests ... OKnoctalia plugins lint wallhaven→0 errors, 0 warningspython3 -m py_compile wallhaven/crop_stream.py→ OKluau-compile --null wallhaven/{panel,wallhaven,shortcut}.luau→ OKSCM_RIGHTSdescriptor, 8-bit RGBA frame size, Fit off/on/off without restarting the helper, quit removes the socket, state, and PID files.Manual Coverage
Hyprland/DP-1 (3440x1440): opened the panel, previewed a 4096x3072 image, toggled Fit on/off, dragged the box, closed the panel. No helper process, socket, state file, or cached full image remained; the current wallpaper was not changed. Fitted Apply targets the focused output, but the apply path itself was not run during automated verification to avoid changing the desktop.
Screenshots / Videos
Captured from an empty workspace at 3440x1440 and cropped to the panel.
Fit off:
Fit on with the draggable monitor-aspect box:
Checklist
translations/en.json, or this PR adds no new user-facing strings.Additional Notes
1.4.1→1.5.0(new feature).python3(crop helper) and ImageMagick (prefersmagick7; falls back to ImageMagick 6convert+identify); both are declared inplugin.tomland documented in the README.onOpenstays cheap: sweeps are detachedrunAsynccalls and the first fetch is deferred toonFrameTick, preserving the CPU-budget fix from fix(wallhaven): keep panel onOpen under its CPU budget on fresh script loads #150.shellQuoteor argv arrays.Wallhaventitle,Wallpaper · Paneltag, Noctalia logo and the Fit crop box visible..part) and crop temp files are swept at panel open, alongside orphaned previews, sockets, and state files.