Skip to content

Conversation

@y0usaf
Copy link
Contributor

@y0usaf y0usaf commented Jan 10, 2026

Add isImageFile() static method to CImage.

Depends on hyprwm/hyprpaper#321

y0usaf added a commit to y0usaf/hyprpaper that referenced this pull request Jan 10, 2026
Use the new isImageFile() static method from Hyprgraphics for robust
image file validation using libmagic instead of try/catch. Depends on
hyprwm/hyprgraphics#41.
@y0usaf y0usaf force-pushed the feat/add-isImageFile branch from 18357bc to 772d53f Compare January 10, 2026 06:28
y0usaf added a commit to y0usaf/hyprpaper that referenced this pull request Jan 10, 2026
Use the new isImageFile() static method from Hyprgraphics for robust
image file validation using libmagic instead of try/catch. Depends on
hyprwm/hyprgraphics#41.
Adds a static isImageFile() method to CImage that validates if a file
path points to a loadable image by attempting to load it. Returns true
only if the image loads successfully. Memory is freed immediately after
the check via scope block.
@y0usaf y0usaf force-pushed the feat/add-isImageFile branch from 772d53f to 52aa6ef Compare January 10, 2026 06:42
Use formatFromFile() which reads only the file header via libmagic
instead of loading and decoding the entire image.
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vaxerski vaxerski merged commit 583331e into hyprwm:main Jan 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants