Skip to content

Commit

Permalink
Fixed bug so IOS 17>= images are handled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisGerritsenCloudflight committed Feb 7, 2025
1 parent 633e71f commit f170354
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ToJpegWorker : public Napi::AsyncWorker {
}

struct heif_image* img;
err = heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGB, nullptr);
err = heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGBA, nullptr);
if (err.code != heif_error_Ok) {
heif_image_handle_release(handle);
heif_context_free(ctx);
Expand All @@ -85,7 +85,7 @@ class ToJpegWorker : public Napi::AsyncWorker {
unsigned long jpegSize = 0;

int flags = 0;
int pixelFormat = TJPF_RGB;
int pixelFormat = TJPF_RGBA;

int ret = tjCompress2(tjInstance, data, width, 0, height, pixelFormat, &jpegBuf, &jpegSize, TJSAMP_444, quality, flags);
if (ret != 0) {
Expand Down

0 comments on commit f170354

Please sign in to comment.