amazon-linux-2023 icon indicating copy to clipboard operation
amazon-linux-2023 copied to clipboard

[Package Request] - libheif and ImageMagick with HEIF/HEIC/AVIF support

Open santialbo opened this issue 2 years ago • 5 comments

What package is missing from Amazon Linux 2023? Please describe and include package name. libheif - is used by ImageMagick to support heic images Is this an update to existing package or new package request? Both Is this package available in Amazon Linux 2? If it is available via external sources such as EPEL, please specify. No Any additional information you'd like to include. (use-cases, etc) HEIC images are becoming more and more common and being able to support them with ImageMagick would be great.

santialbo avatar Mar 30 '23 08:03 santialbo

I am also interested in this. There doesn't seem to be support for HEIC images on Amazon Linux 2 image

When I add RUN yum install libheif-devel to my Dockerfile I get the error No package libheif-devel available - also trying to install libde265 and libde from their github repos passes but the library isn't found and there is no support for heif/heic images

peter-ptd avatar Apr 13 '23 16:04 peter-ptd

is there any update regarding this.. i am also facing the same issue!!

kamrans-7 avatar Feb 13 '25 17:02 kamrans-7

I know this is not a solution for everyone, but if you're struggling with HEIC support like me and you happen to develop a Node.js based application like me, check out heic-decode which works around this issue.

Then, instead of, say:

const resizedFile = sharp(pathname)
  .resize({ width: 1024 })
  .jpeg({ quality: 75 });

do:

import { promises as fs } from 'node:fs';
import decode from 'heic-decode';

// …

let sharpInstance: Sharp;
if (file.mimetype === 'image/heic') {
  const buffer = await fs.readFile(pathname);

  const { width, height, data } = await decode({ buffer });

  sharpInstance = sharp(data, { raw: { width, height, channels: 4 } });
} else {
  sharpInstance = sharp(pathname);
}

and continue whatever you were trying to do, like:

const resizedFile = sharpInstance
  .resize({ width: 1024 })
  .jpeg({ quality: 75 });

wojtekmaj avatar Feb 14 '25 09:02 wojtekmaj

Hi all ,

I’ve written a detailed step-by-step guide on installing #ImageMagick with libheif, libde265, x265, on Amazon Linux 2 and all necessary prerequisites—including troubleshooting tips! Check out my Meduim blog I hope this helps!

Kamran-7 avatar Feb 18 '25 10:02 Kamran-7

Since my request was closed, adding that the update to support HEIC/HEIF for AL2023 and ImageMagick should include AVIF support which is a higher compression output format supported by all major modern browsers. So would be great to see HEIC and AVIF support added. I believe the two formats share some of the same dependencies as far as the supporting libraries.

dougcsd avatar Aug 21 '25 21:08 dougcsd