GraphicsMagick: 3 new changesets

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.8362.1687123276.17398.graphicsmagick-commit@lists.sourceforge.net>
changeset 017ac8e7c670 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=017ac8e7c670
summary: ReadOnePNGImage(): set image orientation according to read EXIF data (if present)

changeset c5379a80396e in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=c5379a80396e
summary: ReadWEBPImage(): set image orientation according to read EXIF data (if present)

changeset dd2a83c5d201 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=dd2a83c5d201
summary: EXIF and PNG: Retrieve image orientation from EXIF (if present) and store in image

diffstat:

 ChangeLog                              |   8 ++++++++
 VisualMagick/installer/inc/version.isx |   4 ++--
 coders/png.c                           |  32 +++++++++++++++++++++++++++-----
 coders/webp.c                          |  24 ++++++++++++++++++++++++
 magick/version.h                       |   4 ++--
 www/Changelog.html                     |   9 +++++++++
 6 files changed, 72 insertions(+), 9 deletions(-)

diffs (163 lines):

diff -r 0f8048d3e7a3 -r dd2a83c5d201 ChangeLog
--- a/ChangeLog	Sun Jun 11 08:51:19 2023 -0500
+++ b/ChangeLog	Sun Jun 18 16:21:01 2023 -0500
@@ -1,3 +1,11 @@
+2023-06-18  Przemysław Sobala  <[email protected]>
+
+	* coders/png.c (ReadOnePNGImage): Retrieve image orientation from
+	EXIF (if present) and store in image.
+
+	* coders/webp.c (ReadWEBPImage): Retrieve image orientation from
+	EXIF (if present) and store in image.
+
 2023-06-11  Bob Friesenhahn  <[email protected]>
 
 	* fuzzing/oss-fuzz-build.sh: Add --no-po4a --no-doxygen to 'xz'
diff -r 0f8048d3e7a3 -r dd2a83c5d201 VisualMagick/installer/inc/version.isx
--- a/VisualMagick/installer/inc/version.isx	Sun Jun 11 08:51:19 2023 -0500
+++ b/VisualMagick/installer/inc/version.isx	Sun Jun 18 16:21:01 2023 -0500
@@ -10,5 +10,5 @@
 
 #define public MagickPackageName "GraphicsMagick"
 #define public MagickPackageVersion "1.4"
-#define public MagickPackageVersionAddendum ".020230611"
-#define public MagickPackageReleaseDate "snapshot-20230611"
+#define public MagickPackageVersionAddendum ".020230618"
+#define public MagickPackageReleaseDate "snapshot-20230618"
diff -r 0f8048d3e7a3 -r dd2a83c5d201 coders/png.c
--- a/coders/png.c	Sun Jun 11 08:51:19 2023 -0500
+++ b/coders/png.c	Sun Jun 18 16:21:01 2023 -0500
@@ -1373,9 +1373,9 @@
 
       if (image->logging)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                              " recognized eXIf chunk");
-
-      profile=MagickAllocateMemory(unsigned char *,chunk->size+6);
+                              "    recognized eXIf chunk");
+
+      profile=MagickAllocateMemory(unsigned char *,chunk->size+app1_hdr_size);
 
       if (profile == (unsigned char *) NULL)
         {
@@ -1447,7 +1447,7 @@
        return(-1); /* Error return */
 
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-             " recognized caNv chunk");
+             "    recognized caNv chunk");
 
      image=(Image *) png_get_user_chunk_ptr(ping);
 
@@ -1460,7 +1460,7 @@
     }
 
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-         " unrecognized user chunk");
+         "    unrecognized user chunk: %s", chunk->name);
 
   return(0); /* Did not recognize */
 }
@@ -2995,6 +2995,28 @@
   UnlockSemaphoreInfo(png_semaphore);
 #endif
 
+  /*
+    Retrieve image orientation from EXIF (if present) and store in
+    image.
+  */
+  {
+    const ImageAttribute
+      *attribute;
+
+    attribute = GetImageAttribute(image,"EXIF:Orientation");
+    if ((attribute != (const ImageAttribute *) NULL) &&
+        (attribute->value != (char *) NULL))
+      {
+        int
+          orientation;
+
+        orientation = MagickAtoI(attribute->value);
+        if ((orientation > UndefinedOrientation) &&
+            (orientation <= LeftBottomOrientation))
+          image->orientation=(OrientationType) orientation;
+      }
+  }
+
   if (logging)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                           "  exit ReadOnePNGImage()");
diff -r 0f8048d3e7a3 -r dd2a83c5d201 coders/webp.c
--- a/coders/webp.c	Sun Jun 11 08:51:19 2023 -0500
+++ b/coders/webp.c	Sun Jun 18 16:21:01 2023 -0500
@@ -37,6 +37,7 @@
   Include declarations.
 */
 #include "magick/studio.h"
+#include "magick/attribute.h"
 #include "magick/blob.h"
 #include "magick/colormap.h"
 #include "magick/log.h"
@@ -361,6 +362,29 @@
   pixels=(unsigned char *) NULL;
   MagickFreeResourceLimitedMemory(stream);
   CloseBlob(image);
+
+  /*
+    Retrieve image orientation from EXIF (if present) and store in
+    image.
+  */
+  {
+    const ImageAttribute
+      *attribute;
+
+    attribute = GetImageAttribute(image,"EXIF:Orientation");
+    if ((attribute != (const ImageAttribute *) NULL) &&
+        (attribute->value != (char *) NULL))
+      {
+        int
+          orientation;
+
+        orientation=MagickAtoI(attribute->value);
+        if ((orientation > UndefinedOrientation) &&
+            (orientation <= LeftBottomOrientation))
+          image->orientation=(OrientationType) orientation;
+      }
+  }
+
   StopTimer(&image->timer);
   return(image);
 }
diff -r 0f8048d3e7a3 -r dd2a83c5d201 magick/version.h
--- a/magick/version.h	Sun Jun 11 08:51:19 2023 -0500
+++ b/magick/version.h	Sun Jun 18 16:21:01 2023 -0500
@@ -38,8 +38,8 @@
 #define MagickLibVersion  0x272402
 #define MagickLibVersionText  "1.4"
 #define MagickLibVersionNumber 27,24,2
-#define MagickChangeDate   "20230611"
-#define MagickReleaseDate  "snapshot-20230611"
+#define MagickChangeDate   "20230618"
+#define MagickReleaseDate  "snapshot-20230618"
 
 /*
   The MagickLibInterfaceNewest and MagickLibInterfaceOldest defines
diff -r 0f8048d3e7a3 -r dd2a83c5d201 www/Changelog.html
--- a/www/Changelog.html	Sun Jun 11 08:51:19 2023 -0500
+++ b/www/Changelog.html	Sun Jun 18 16:21:01 2023 -0500
@@ -37,6 +37,15 @@
 </div>
 
 <div class="document">
+<p>2023-06-18  Przemysław Sobala  &lt;<a class="reference external" href="mailto:przemyslaw&#46;sobala&#37;&#52;&#48;gmail&#46;com">przemyslaw<span>&#46;</span>sobala<span>&#64;</span>gmail<span>&#46;</span>com</a>&gt;</p>
+<blockquote>
+<ul class="simple">
+<li><p>coders/png.c (ReadOnePNGImage): Retrieve image orientation from
+EXIF (if present) and store in image.</p></li>
+<li><p>coders/webp.c (ReadWEBPImage): Retrieve image orientation from
+EXIF (if present) and store in image.</p></li>
+</ul>
+</blockquote>
 <p>2023-06-11  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">
_______________________________________________
Graphicsmagick-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-commit
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.