Skip to content

enable gif-support #4694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Rishikesh63
Copy link

@Rishikesh63 Rishikesh63 commented May 20, 2025

This PR resolves issue #4560 by extending MediaBlock to support .gif files in addition to .png and .jpg. A hidden file input now accepts all common image formats, allowing students to import animated GIFs for their MusicBlocks projects .

Copy link

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

@walterbender
Copy link
Member

The gif files load but don't animate.

@Rishikesh63
Copy link
Author

@walterbender if i removed this part even then i am able to import images and gif
/**
* Represents a block that imports an image.
* @Class
* @extends ValueBlock
/
class MediaBlock extends ValueBlock {
/
*
* Constructs a MediaBlock instance.
* @constructor
*/
constructor() {
super("media", _("Media").toLowerCase());

        // Set palette and activity for the block
        this.setPalette("media", activity);
        this.beginnerBlock(true);

        // Set help string for the block
        this.setHelpString([
            _("The Media block is used to import an image."),
            "documentation",
            null,
            "turtleshell"
        ]);

        // Form block with image and output type
        this.formBlock({
            image: "images/load-media.svg",
            outType: "mediaout"
        });
    }
}.   

@Rishikesh63
Copy link
Author

i am asking which part of code is related to importing images

@Rishikesh63
Copy link
Author

@walterbender i comment out the mediablock.js to see is there any effect of this on media or not , i have seen there is not any effect of it

@walterbender
Copy link
Member

I am not sure how you would import an image (or use it) w/o the media block.

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