Skip to content

Feature: Add GIF Support to MediaBlock and ShowBlock#4656

Closed
rashap224 wants to merge 2 commits intosugarlabs:masterfrom
rashap224:feature-add-gif-support
Closed

Feature: Add GIF Support to MediaBlock and ShowBlock#4656
rashap224 wants to merge 2 commits intosugarlabs:masterfrom
rashap224:feature-add-gif-support

Conversation

@rashap224
Copy link

Issue Reference: Fixes #4560

Description
This pull request introduces GIF support to the MediaBlock and ShowBlock classes, allowing users to import and display GIFs within the application. The feature enhances the media capabilities of Music Blocks by enabling dynamic and animated content.

Changes Made

1. MediaBlock Enhancements:

  • Updated the MediaBlock class to handle GIF files.
  • Integrated a GIF playback library (e.g., gif.js) to process and display GIFs.
  • Modified the loadThumbnail method to detect and handle GIF files appropriately.

2. ShowBlock Enhancements:

  • Ensured the ShowBlock class can render GIFs on the canvas.
  • Adjusted the flow logic to support animated media.

3. Documentation:

  • Updated the help strings for the MediaBlock to reflect GIF support.

Testing

  • Verified that GIFs can be imported and displayed correctly using the MediaBlock.
  • Confirmed that the ShowBlock renders GIFs as expected on the canvas.
  • Ran the full test suite to ensure no regressions were introduced.

Impact

  • Adds support for animated media (GIFs) to the application.
  • Enhances the user experience by enabling dynamic visual content.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@rashap224
Copy link
Author

@pikurasa Can u review the PR for this issue and provide feedback.

@FirePheonix
Copy link
Contributor

@rashap224 can you please provide a video recording of this fix?

@pikurasa
Copy link
Collaborator

@rashap224

I tested it, but it doesn't seem to work.

Log:

Uncaught TypeError: Cannot set properties of undefined (setting 'connections')
    at Blocks.makeBlock (blocks.js:3597:47)
    at paletteBlockButtonPush (palette.js:32:24)
    at Palette._makeBlockFromPalette (palette.js:1296:30)
    at Palette._makeBlockFromProtoblock (palette.js:1424:33)
    at Image.up (palette.js:1047:26)

Screenshot from 2025-04-27 20-30-29

@Rishikesh63
Copy link

@pikurasa i think @rashap224 removed prototype for text ,error is due to that

@github-actions
Copy link
Contributor

This pull request has been open for more than 60 days without any activity. It will be closed in 3 days unless the stale label is removed or commented on.

@github-actions github-actions bot added the Stale label Jul 20, 2025
@github-actions
Copy link
Contributor

Closed pull request due to inactivity for more than 63 days.

@github-actions github-actions bot closed this Jul 23, 2025
@ShivamS-D
Copy link

Can you assign this issue to me??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GIF support for media block

5 participants