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

Closed
matteo-naif opened this issue Apr 30, 2024 · 1 comment · Fixed by #6621
Closed

How to preserve animation with gif crop #6146

matteo-naif opened this issue Apr 30, 2024 · 1 comment · Fixed by #6621
Assignees

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 status: needs-triage Possible bug which hasn't been reproduced yet label Apr 30, 2024
@cbratschi
Copy link

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

@PatrikKozak PatrikKozak self-assigned this Jun 4, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Jun 4, 2024
@PatrikKozak PatrikKozak linked a pull request Jun 4, 2024 that will close this issue
3 tasks
denolfe pushed a commit that referenced this issue Jun 4, 2024
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 a pull request may close this issue.

3 participants