summaryrefslogtreecommitdiffstats
path: root/heif.patch
blob: 086f28cce6e7e78145a0b6c72da3a863a940d789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From ffc2aaae543dcd60c6cc7e5a426f66dbc51df560 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Mon, 21 Mar 2022 21:53:40 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/4972

---
 coders/heic.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/coders/heic.c b/coders/heic.c
index 96b4e218fc..846f5c7575 100644
--- a/coders/heic.c
+++ b/coders/heic.c
@@ -318,13 +318,17 @@ static MagickBooleanType ReadHEICImageHandle(const ImageInfo *image_info,
   if (preserve_orientation == MagickTrue)
     decode_options->ignore_transformations=1;
   chroma=heif_chroma_interleaved_RGB;
+#if LIBHEIF_NUMERIC_VERSION > 0x01040000
   if (image->depth > 8)
     chroma=heif_chroma_interleaved_RRGGBB_LE;
+#endif
   if (image->alpha_trait != UndefinedPixelTrait)
     {
       chroma=heif_chroma_interleaved_RGBA;
+#if LIBHEIF_NUMERIC_VERSION > 0x01040000
       if (image->depth > 8)
         chroma=heif_chroma_interleaved_RRGGBBAA_LE;
+#endif
     }
   error=heif_decode_image(image_handle,&heif_image,heif_colorspace_RGB,chroma,
     decode_options);
@@ -1225,16 +1229,20 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
           status=TransformImageColorspace(image,sRGBColorspace,exception);
         colorspace=heif_colorspace_RGB;
         chroma=heif_chroma_interleaved_RGBA;
+#if LIBHEIF_NUMERIC_VERSION > 0x01040000
         if (image->depth > 8)
           chroma=heif_chroma_interleaved_RRGGBBAA_LE;
+#endif
       }
     else
       if (IssRGBCompatibleColorspace(image->colorspace) != MagickFalse)
         {
           colorspace=heif_colorspace_RGB;
           chroma=heif_chroma_interleaved_RGB;
+#if LIBHEIF_NUMERIC_VERSION > 0x01040000
           if (image->depth > 8)
             chroma=heif_chroma_interleaved_RRGGBB_LE;
+#endif
           if (GetPixelChannels(image) == 1)
             {
               colorspace=heif_colorspace_monochrome;
@@ -1265,9 +1273,11 @@ static MagickBooleanType WriteHEICImage(const ImageInfo *image_info,
     if (colorspace == heif_colorspace_YCbCr)
       status=WriteHEICImageYCbCr(image,heif_image,exception);
     else
+#if LIBHEIF_NUMERIC_VERSION > 0x01040000
       if (image->depth > 8)
         status=WriteHEICImageRRGGBBAA(image,heif_image,exception);
       else
+#endif
         status=WriteHEICImageRGBA(image,heif_image,exception);
     if (status == MagickFalse)
       break;