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

I want to resize my apng file, but I need help. #3195

Closed
dogemad opened this issue Apr 18, 2022 · 1 comment
Closed

I want to resize my apng file, but I need help. #3195

dogemad opened this issue Apr 18, 2022 · 1 comment
Labels

Comments

@dogemad
Copy link

dogemad commented Apr 18, 2022

this is my codes.

const sharp = require('sharp');
const fs = require('fs/promises');

async function start() {
  const src = await fs.readFile('./src/0023ac17-e520-4ae4-9308-500608d5fad8.png'); // apng file

  const sample = await sharp(src, { animated: true })
    .resize({ width: 320, height: 320, fit: 'fill', fastShrinkOnLoad: false })
    .toFile('./dist/0023ac17-e520-4ae4-9308-500608d5fad8.png'); // only resized first frame, like thumbnail...
}

start();

What I expected is that the apng file is saved with only the size changed.
However, only the first frame was saved with the changed size. How do I resize and save all frames?

@lovell
Copy link
Owner

lovell commented Apr 18, 2022

Please see future possible enhancement #2375

@lovell lovell closed this as completed Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants