Skip to content
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

How to preserve animation with gif crop #6146

Open
matteo-naif opened this issue Apr 30, 2024 · 1 comment
Open

How to preserve animation with gif crop #6146

matteo-naif opened this issue Apr 30, 2024 · 1 comment
Labels
[possible-bug] Possible bug which hasn't been reproduced yet

Comments

@matteo-naif
Copy link

Link to reproduction

Describe the Bug

When I upload an animated gif in media collection the crops created lose the animation.

I have to add specific options in crop definition to handle it?

To Reproduce

  1. Define collection media
const Media: CollectionConfig = {
	slug: "media",
	fields: [
		{
			name: "title",
			type: "text",
			localized: true,
			required: true,
		}
	],
	upload: {
		staticDir: path.resolve(__dirname, "../../media"),
		imageSizes: [
			{
				name: "squareSmall",
				width: 480,
				height: 480,
				position: "centre",
				withoutEnlargement: false
			},
		],
		adminThumbnail: ({ doc }: { doc: any }) => {
			const url = doc.sizes.squareSmall.url || doc.url;
			return url;
		},
		mimeTypes: ["image/*", "application/pdf"],

	}
};
  1. Upload an animated gif from admin UI (https://upload.wikimedia.org/wikipedia/commons/a/a0/Cartoon_steamer_duck_walking_animation.gif)
  2. The crop lose the animation

Payload Version

2.12.1

Adapters and Plugins

	"@payloadcms/bundler-webpack": "1.0.6", 		"@payloadcms/db-mongodb": "1.4.4", 		"@payloadcms/plugin-cloud-storage": "1.1.2", 		"@payloadcms/plugin-form-builder": "1.2.1", 		"@payloadcms/plugin-nested-docs": "1.0.12", 		"@payloadcms/plugin-seo": "2.3.0", 		"@payloadcms/richtext-lexical": "0.8.0", 		"@payloadcms/richtext-slate": "1.5.0",
@matteo-naif matteo-naif added the [possible-bug] Possible bug which hasn't been reproduced yet label Apr 30, 2024
@cbratschi
Copy link

Reported this here with some workarounds:
#2181 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[possible-bug] Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants