GraphicsMagick: JP2: Handle writing image with a dimension of 1

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.38700.1672617741.1350.graphicsmagick-commit@lists.sourceforge.net>
changeset 951e5b069e5d in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=951e5b069e5d
summary: JP2: Handle writing image with a dimension of 1

diffstat:

 ChangeLog          |   8 ++++++--
 coders/pcd.c       |   6 +++---
 tests/rwfile.tap   |   9 +++++----
 www/Changelog.html |  15 +++++++++++++++
 4 files changed, 29 insertions(+), 9 deletions(-)

diffs (97 lines):

diff -r ddaea7fc4a5e -r 951e5b069e5d ChangeLog
--- a/ChangeLog	Mon Jan 02 00:29:01 2023 +0100
+++ b/ChangeLog	Sun Jan 01 18:02:07 2023 -0600
@@ -1,10 +1,14 @@
+2023-01-01  Bob Friesenhahn  <[email protected]>
+
+	* coders/pcd.c (WritePCDTile): Handle writing image with a
+	dimension of 1.
+
 2023-01-02 Fojtik Jaroslav  <[email protected]>
 
-	* jp2/* Update lib jasper to 2.0.33. Code cleanly compilles, but 
+	* jp2/* Update lib jasper to 2.0.33. Code cleanly compilles, but
 	there is still some problem. Will be solved later.
 	- jp2/src/lib/jasper/include/jasper/stdbool2.h No longer needed.
 
-
 2023-01-01  Bob Friesenhahn  <[email protected]>
 
 	* magick/utility.c (GetMagickGeometry): Assure that width and
diff -r ddaea7fc4a5e -r 951e5b069e5d coders/pcd.c
--- a/coders/pcd.c	Mon Jan 02 00:29:01 2023 +0100
+++ b/coders/pcd.c	Sun Jan 01 18:02:07 2023 -0600
@@ -1050,11 +1050,11 @@
   (void) GetMagickGeometry(page_geometry,&geometry.x,&geometry.y,
     &geometry.width,&geometry.height);
   if ((geometry.width % 2) != 0)
-    geometry.width--;
+    geometry.width = geometry.width > 1 ? geometry.width-1 : geometry.width+1 ;
   if ((geometry.height % 2) != 0)
-    geometry.height--;
+    geometry.height = geometry.height > 1 ? geometry.height-1 : geometry.height+1;
   tile_image=ResizeImage(image,geometry.width,geometry.height,TriangleFilter,
-    1.0,&image->exception);
+                         1.0,&image->exception);
   if (tile_image == (Image *) NULL)
     return(False);
   (void) sscanf(page_geometry,"%lux%lu",&geometry.width,&geometry.height);
diff -r ddaea7fc4a5e -r 951e5b069e5d tests/rwfile.tap
--- a/tests/rwfile.tap	Mon Jan 02 00:29:01 2023 +0100
+++ b/tests/rwfile.tap	Sun Jan 01 18:02:07 2023 -0600
@@ -1,6 +1,6 @@
 #!/bin/sh
 # -*- shell-script -*-
-# Copyright (C) 2004-2017 GraphicsMagick Group
+# Copyright (C) 2004-2023 GraphicsMagick Group
 . ./common.shi
 . ${top_srcdir}/tests/common.shi
 
@@ -8,10 +8,11 @@
 rwfile=./rwfile
 
 # Types we will test
-check_types='bilevel gray pallette truecolor' # truecolor_1x266
+check_types='bilevel gray pallette truecolor truecolor_1x266'
+check_types_noone='bilevel gray pallette truecolor'
 
 # Number of tests we plan to run
-test_plan_fn 656
+test_plan_fn 818 # 820
 
 # ART format
 for type in ${check_types}
@@ -331,7 +332,7 @@
 done
 
 # PICT format
-for type in ${check_types}
+for type in ${check_types_noone}
 do
   test_command_fn "PICT ${type}" ${MEMCHECK} ${rwfile} -filespec "out_${type}_%d" "${SRCDIR}/input_${type}.miff" PICT
   test_command_fn "PICT ${type} (stdio)" ${MEMCHECK} ${rwfile} -stdio -filespec "out_${type}_stdio_%d" "${SRCDIR}/input_${type}.miff" PICT
diff -r ddaea7fc4a5e -r 951e5b069e5d www/Changelog.html
--- a/www/Changelog.html	Mon Jan 02 00:29:01 2023 +0100
+++ b/www/Changelog.html	Sun Jan 01 18:02:07 2023 -0600
@@ -40,6 +40,21 @@
 <p>2023-01-01  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/pcd.c (WritePCDTile): Handle writing image with a
+dimension of 1.</p></li>
+</ul>
+</blockquote>
+<p>2023-01-02 Fojtik Jaroslav  &lt;<a class="reference external" href="mailto:JaFojtik&#37;&#52;&#48;yandex&#46;com">JaFojtik<span>&#64;</span>yandex<span>&#46;</span>com</a>&gt;</p>
+<blockquote>
+<ul class="simple">
+<li><p>jp2/* Update lib jasper to 2.0.33. Code cleanly compilles, but
+there is still some problem. Will be solved later.
+- jp2/src/lib/jasper/include/jasper/stdbool2.h No longer needed.</p></li>
+</ul>
+</blockquote>
+<p>2023-01-01  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>magick/utility.c (GetMagickGeometry): Assure that width and
 height are not scaled down to zero since it is an invalid value.</p></li>
 <li><p>coders/sun.c (ReadSUNImage): Enlarge RLE output buffer in order
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.