Skip to content

Conversation

@AlexAndBear
Copy link
Contributor

…wless

Description

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for extracting the first frame from GIF files so that the space image cropper can operate on a static image. Key changes include:

  • Introducing extractFirstFrameFromGif to convert GIFs into a single-frame PNG blob.
  • Updating the onMounted hook to conditionally extract the first frame for GIFs before creating the object URL.
  • Minor reordering of Vue imports.
Comments suppressed due to low confidence (1)

packages/web-pkg/src/components/Spaces/SpaceImageModal.vue:115

  • Consider adding unit tests for extractFirstFrameFromGif to verify it correctly handles valid GIFs, rejects on errors, and produces a valid PNG blob.
const extractFirstFrameFromGif = (file: File): Promise<Blob> => {

@AlexAndBear AlexAndBear force-pushed the space-image-support-gif branch from 6a7bd47 to aa877fc Compare May 25, 2025 00:25
@AlexAndBear AlexAndBear force-pushed the space-image-support-gif branch from aa877fc to 8c9196f Compare May 25, 2025 00:30
Copy link
Contributor

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Wow, this works really, really well. Thank you for "fixing" this detail! 😍

@AlexAndBear AlexAndBear merged commit 28fb65c into main May 26, 2025
18 checks passed
@AlexAndBear AlexAndBear deleted the space-image-support-gif branch May 26, 2025 08:40
@openclouders openclouders mentioned this pull request May 26, 2025
1 task
@ScharfViktor
Copy link
Contributor

We set the first frame from the .dif and it works, but the users don't get what they want when they upload the .dif (we have no animation).

maybe is better way to disallow uploading .dif?

@openclouders openclouders mentioned this pull request Jun 2, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants