converting heic image to png / jpeg with sharp node.js
Asked Answered
A

0

8

When I want to convert png file like this

const file = await this.awsS3Service.getObject(fileEntity.awsS3Key);

const body = await this.awsS3Service.streamToBuffer(file.Body as Readable);

const outputBuffer = await sharp(body).toFormat('png').toBuffer();

i get file from aws and then convert file to buffer and then want to convert heic image to png or jpeg image. On this line await sharp(body).toFormat('png').toBuffer(); I get error Stack: Error: source: bad seek to 1508850 heif: Unsupported feature: Unsupported codec (4.3000)

I tried also

const outputBuffer = await sharp(body).png().toBuffer();

, but this was working like one month ago

Amasa answered 19/9, 2023 at 18:12 Comment(1)
also wondering on a solution, any luck ?Zoltai

© 2022 - 2024 — McMap. All rights reserved.