GraphicsMagick: PNG: Use lower-case raw profile identifiers

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.40872.1673196900.1567.graphicsmagick-commit@lists.sourceforge.net>
changeset 403c91fe1f53 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=403c91fe1f53
summary: PNG: Use lower-case raw profile identifiers

diffstat:

 ChangeLog          |   5 +++++
 coders/png.c       |  10 ++++++++--
 www/Changelog.html |   4 ++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diffs (64 lines):

diff -r 8d887d58dff3 -r 403c91fe1f53 ChangeLog
--- a/ChangeLog	Sun Jan 08 09:13:11 2023 -0600
+++ b/ChangeLog	Sun Jan 08 10:54:47 2023 -0600
@@ -1,5 +1,10 @@
 2023-01-08  Bob Friesenhahn  <[email protected]>
 
+	* coders/png.c (WriteOnePNGImage): Use lower-case raw profile
+	identifiers (e.g. 'Raw profile type xmp') because exiftool expects
+	that.  Partially addresses concerns raised by SourceForge bug #682
+	"Invalid storage of XMP in PNGs".
+
 	* www/INSTALL-unix.rst: Add notes about required libjxl versions.
 
 	* README.txt: Add notes about required libjxl versions.
diff -r 8d887d58dff3 -r 403c91fe1f53 coders/png.c
--- a/coders/png.c	Sun Jan 08 09:13:11 2023 -0600
+++ b/coders/png.c	Sun Jan 08 10:54:47 2023 -0600
@@ -1297,6 +1297,7 @@
   else
     {
       strlcpy(profile_name,&text[ii].key[17],sizeof(profile_name));
+      LocaleUpper(profile_name);
       strlcpy(profile_description,"generic profile, type ",
               sizeof(profile_description));
       strlcat(profile_description,&text[ii].key[17],
@@ -8194,17 +8195,22 @@
     if (profile_iterator)
       {
         const char
-          *profile_name;
+          *profile_name_uc;
 
         const unsigned char
           *profile_info;
 
+        char
+          profile_name[MaxTextExtent];
+
         size_t
           profile_length;
 
-        while (NextImageProfile(profile_iterator,&profile_name,&profile_info,
+        while (NextImageProfile(profile_iterator,&profile_name_uc,&profile_info,
                                 &profile_length) != MagickFail)
           {
+            (void) strlcpy(profile_name, profile_name_uc, sizeof(profile_name));
+            LocaleLower(profile_name);
             if (LocaleCompare(profile_name,"ICM") == 0)
               {
 #if defined(PNG_WRITE_iCCP_SUPPORTED)
diff -r 8d887d58dff3 -r 403c91fe1f53 www/Changelog.html
--- a/www/Changelog.html	Sun Jan 08 09:13:11 2023 -0600
+++ b/www/Changelog.html	Sun Jan 08 10:54:47 2023 -0600
@@ -40,6 +40,10 @@
 <p>2023-01-08  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/png.c (WriteOnePNGImage): Use lower-case raw profile
+identifiers (e.g. 'Raw profile type xmp') because exiftool expects
+that.  Partially addresses concerns raised by SourceForge bug #682
+&quot;Invalid storage of XMP in PNGs&quot;.</p></li>
 <li><p>www/INSTALL-unix.rst: Add notes about required libjxl versions.</p></li>
 <li><p>README.txt: Add notes about required libjxl versions.</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.