GraphicsMagick: HEIF: Set ignore_transformations = MagickTrue fo...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.777.1683304006.1564.graphicsmagick-commit@lists.sourceforge.net>
changeset ffb178285bcb in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=ffb178285bcb
summary: HEIF: Set ignore_transformations = MagickTrue for old libheif versions

diffstat:

 ChangeLog          |   4 ++++
 coders/heif.c      |  19 +++++++++++++------
 www/Changelog.html |   3 +++
 3 files changed, 20 insertions(+), 6 deletions(-)

diffs (63 lines):

diff -r 866e04ffa779 -r ffb178285bcb ChangeLog
--- a/ChangeLog	Fri May 05 11:11:54 2023 -0500
+++ b/ChangeLog	Fri May 05 11:26:31 2023 -0500
@@ -1,5 +1,9 @@
 2023-05-05  Bob Friesenhahn  <[email protected]>
 
+	* coders/heif.c (ReadHEIFImage): Implemented Tobias Mark's idea
+	for how ignore_transformations should be supported for older
+	libheif versions.
+
 	* coders/topol.c: Eliminate warnings and add some more error
 	checks.
 
diff -r 866e04ffa779 -r ffb178285bcb coders/heif.c
--- a/coders/heif.c	Fri May 05 11:11:54 2023 -0500
+++ b/coders/heif.c	Fri May 05 11:26:31 2023 -0500
@@ -461,9 +461,6 @@
   PixelPacket
     *q;
 
-  const char
-    *value;
-
   MagickBool
     ignore_transformations;
 
@@ -490,10 +487,20 @@
   if (ReadBlob(image,in_len,in_buf) != in_len)
     ThrowHEIFReaderException(CorruptImageError, UnexpectedEndOfFile, image);
 
+#if LIBHEIF_NUMERIC_VERSION >= 0x01090000
   ignore_transformations = MagickFalse;
-  if ((value=AccessDefinition(image_info,"heif","ignore-transformations")))
-    if (LocaleCompare(value,"TRUE") == 0)
-      ignore_transformations = MagickTrue;
+  {
+    const char
+      *value;
+
+    if ((value=AccessDefinition(image_info,"heif","ignore-transformations")))
+      if (LocaleCompare(value,"TRUE") == 0)
+        ignore_transformations = MagickTrue;
+  }
+#else
+  /* Older versions are missing required function to get real width/height. */
+  ignore_transformations = MagickTrue;
+#endif
 
   /* Init HEIF-Decoder handles */
   heif=heif_context_alloc();
diff -r 866e04ffa779 -r ffb178285bcb www/Changelog.html
--- a/www/Changelog.html	Fri May 05 11:11:54 2023 -0500
+++ b/www/Changelog.html	Fri May 05 11:26:31 2023 -0500
@@ -40,6 +40,9 @@
 <p>2023-05-05  Bob Friesenhahn  &lt;<a class="reference external" href="mailto:bfriesen&#37;&#52;&#48;simple&#46;dallas&#46;tx&#46;us">bfriesen<span>&#64;</span>simple<span>&#46;</span>dallas<span>&#46;</span>tx<span>&#46;</span>us</a>&gt;</p>
 <blockquote>
 <ul class="simple">
+<li><p>coders/heif.c (ReadHEIFImage): Implemented Tobias Mark's idea
+for how ignore_transformations should be supported for older
+libheif versions.</p></li>
 <li><p>coders/topol.c: Eliminate warnings and add some more error
 checks.</p></li>
 </ul>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.