Skip to content

feat: gif support for profile picture#1366

Closed
TakuyaYagam1 wants to merge 1 commit into
caelestia-dots:mainfrom
TakuyaYagam1:main
Closed

feat: gif support for profile picture#1366
TakuyaYagam1 wants to merge 1 commit into
caelestia-dots:mainfrom
TakuyaYagam1:main

Conversation

@TakuyaYagam1

Copy link
Copy Markdown

Summary

  • Add animated GIF support for profile pictures (~/.face)
  • New ProfileImage component that detects image format via magic bytes (QImageReader) and switches between AnimatedImage (GIF) and CachingImage (static)
  • GIF added to file picker filter so users can select .gif files directly

Changes

  • CUtils::imageFormat() — new C++ method for format detection without file extension
  • components/images/ProfileImage.qml — Loader-based component switching between animated/static rendering
  • Updated User.qml (dashboard) and Center.qml (lock screen) to use ProfileImage
  • Added gif to valid image types in Images.qml
gif.mp4

Purple squares are an unrelated icon loading issue, not caused by this PR.

Copilot AI review requested due to automatic review settings April 1, 2026 19:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds animated GIF support for profile pictures (~/.face) by introducing a format-detecting ProfileImage component that switches between animated and static rendering.

Changes:

  • Add gif to supported image types/extensions for the file picker.
  • Introduce CUtils::imageFormat() (QImageReader-based) for extension-independent format detection.
  • Replace CachingImage usage with ProfileImage in dashboard and lock screen profile-picture views.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
utils/Images.qml Extends allowed image extensions/types to include GIF.
plugin/src/Caelestia/cutils.hpp Exposes new QML-invokable imageFormat() helper.
plugin/src/Caelestia/cutils.cpp Implements format detection via QImageReader::imageFormat().
modules/lock/Center.qml Switches lock-screen avatar rendering to ProfileImage.
modules/dashboard/dash/User.qml Switches dashboard avatar to ProfileImage and triggers reload after picker accept.
components/images/ProfileImage.qml New loader-based component selecting AnimatedImage vs CachingImage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread components/images/ProfileImage.qml
Comment thread components/images/ProfileImage.qml Outdated
@TakuyaYagam1

Copy link
Copy Markdown
Author

CI failures are pre-existing and unrelated to this PR:

  • No PanelWindow backend loaded - Wayland backend unavailable in CI
  • Member "status" not found on type "QObject" - qmllint limitation with Loader.item type resolution
  • Unused import qs.utils in Center.qml - false positive, Paths.home is used from it

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread components/images/ProfileImage.qml Outdated
Comment thread components/images/ProfileImage.qml Outdated
Comment thread components/images/ProfileImage.qml
Comment thread plugin/src/Caelestia/cutils.hpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread components/images/ProfileImage.qml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/Images.qml Outdated
@TakuyaYagam1 TakuyaYagam1 force-pushed the main branch 2 times, most recently from 63b6188 to 93d8368 Compare April 14, 2026 20:13
@TakuyaYagam1 TakuyaYagam1 force-pushed the main branch 4 times, most recently from 13d7d2b to 0148a73 Compare April 29, 2026 19:59
@TakuyaYagam1

Copy link
Copy Markdown
Author

Quick update: I rebased the PR on top of the latest upstream changes after the new image cache provider merge.

I tested an additional follow-up that moved image format detection into Caelestia.Images.IUtils and disabled QML memory cache for profile images, but that version regressed GIF loading on my NixOS setup, so I rolled it back for now.

The current branch keeps the stable behavior:

  • GIF profile pictures use AnimatedImage, preserving animation.
  • Static profile pictures continue to use the upstream CachingImage path.
  • Global CachingImage behavior is unchanged.

I’ll keep the PR focused on the working GIF support first, and can revisit deeper integration with the new image utils/cache provider separately if needed.

@TakuyaYagam1

Copy link
Copy Markdown
Author

Updated this PR after the upstream image cache provider changes.

The current version keeps GIF profile pictures on AnimatedImage, so animation is preserved and GIFs do not go through the static image cache provider. Static profile pictures still use the upstream CachingImage path.

Follow-up polish included:

  • disabled QML memory cache only for profile images, so replacing ~/.face updates reliably;
  • deferred dashboard profile image reload after picker accept;
  • made image extension checks case-insensitive for .GIF, .PNG, .JPG, etc.

I intentionally avoided changing global CachingImage behavior and left MP4/WebM support out of scope for this PR.

Tested on my NixOS setup by rebuilding Caelestia Shell and selecting/replacing GIF profile pictures. Everything works as expected.

@TakuyaYagam1

TakuyaYagam1 commented Jun 7, 2026

Copy link
Copy Markdown
Author

Rebased/merged onto the latest 2.0 changes, resolved conflicts, and re-tested GIF profile images. Also fixed the flake rev fallback so nix run github:TakuyaYagam1/shell/main works cleanly.

recording_20260607_23-39-35.mp4

@TakuyaYagam1

Copy link
Copy Markdown
Author

Im closing this PR, opening a new one with the same feat, and finally without this copilot

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