Update heic-convert to 2.1.0

This commit is contained in:
Fedor Indutny 2024-08-05 13:26:40 -07:00 committed by GitHub
parent c4f0db0307
commit 610e441de9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 27 deletions

View file

@ -15,7 +15,7 @@ if (!parentPort) {
const port = parentPort;
function respond(uuid: string, error: Error | undefined, response?: File) {
function respond(uuid: string, error: Error | undefined, response?: Buffer) {
const wrappedResponse: WrappedWorkerResponse = {
uuid,
error: error?.stack,
@ -26,13 +26,13 @@ function respond(uuid: string, error: Error | undefined, response?: File) {
port.on('message', async ({ uuid, data }: WrappedWorkerRequest) => {
try {
const file = await heicConvert({
const buf = await heicConvert({
buffer: new Uint8Array(data),
format: 'JPEG',
quality: 0.75,
});
respond(uuid, undefined, file);
respond(uuid, undefined, buf);
} catch (error) {
respond(uuid, error, undefined);
}