|
| 1 | +From 80c3f0f9ca0e882c4af1b98ccf473411ccbc123f Mon Sep 17 00:00:00 2001 |
| 2 | +From: Lee Howard < [email protected]> |
| 3 | +Date: Mon, 19 May 2025 10:53:30 -0700 |
| 4 | +Subject: [PATCH 1/3] Don't skip the first line of the input image. Addresses |
| 5 | + issue #703 |
| 6 | + |
| 7 | +--- |
| 8 | + archive/tools/tiffdither.c | 4 ++-- |
| 9 | + archive/tools/tiffmedian.c | 4 ++-- |
| 10 | + 2 files changed, 4 insertions(+), 4 deletions(-) |
| 11 | + |
| 12 | +diff --git a/archive/tools/tiffdither.c b/archive/tools/tiffdither.c |
| 13 | +index 187a61a..0c86e7f 100644 |
| 14 | +--- a/archive/tools/tiffdither.c |
| 15 | ++++ b/archive/tools/tiffdither.c |
| 16 | +@@ -98,7 +98,7 @@ static int fsdither(TIFF *in, TIFF *out) |
| 17 | + nextptr = nextline; |
| 18 | + for (j = 0; j < imagewidth; ++j) |
| 19 | + *nextptr++ = *inptr++; |
| 20 | +- for (i = 1; i < imagelength; ++i) |
| 21 | ++ for (i = 0; i < imagelength; ++i) |
| 22 | + { |
| 23 | + tmpptr = thisline; |
| 24 | + thisline = nextline; |
| 25 | +@@ -146,7 +146,7 @@ static int fsdither(TIFF *in, TIFF *out) |
| 26 | + nextptr[0] += v / 16; |
| 27 | + } |
| 28 | + } |
| 29 | +- if (TIFFWriteScanline(out, outline, i - 1, 0) < 0) |
| 30 | ++ if (TIFFWriteScanline(out, outline, i, 0) < 0) |
| 31 | + goto skip_on_error; |
| 32 | + } |
| 33 | + goto exit_label; |
| 34 | +diff --git a/archive/tools/tiffmedian.c b/archive/tools/tiffmedian.c |
| 35 | +index 334566a..291e73b 100644 |
| 36 | +--- a/archive/tools/tiffmedian.c |
| 37 | ++++ b/archive/tools/tiffmedian.c |
| 38 | +@@ -912,7 +912,7 @@ static void quant_fsdither(TIFF *in, TIFF *out) |
| 39 | + outline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out)); |
| 40 | + |
| 41 | + GetInputLine(in, 0, goto bad); /* get first line */ |
| 42 | +- for (i = 1; i <= imagelength; ++i) |
| 43 | ++ for (i = 0; i <= imagelength; ++i) |
| 44 | + { |
| 45 | + SWAP(short *, thisline, nextline); |
| 46 | + lastline = (i >= imax); |
| 47 | +@@ -992,7 +992,7 @@ static void quant_fsdither(TIFF *in, TIFF *out) |
| 48 | + nextptr += 3; |
| 49 | + } |
| 50 | + } |
| 51 | +- if (TIFFWriteScanline(out, outline, i - 1, 0) < 0) |
| 52 | ++ if (TIFFWriteScanline(out, outline, i, 0) < 0) |
| 53 | + break; |
| 54 | + } |
| 55 | + bad: |
| 56 | +-- |
| 57 | +2.45.4 |
| 58 | + |
| 59 | + |
| 60 | +From e39690d84c229788cdceec9cd4d11f46aad72da7 Mon Sep 17 00:00:00 2001 |
| 61 | +From: Lee Howard < [email protected]> |
| 62 | +Date: Sat, 24 May 2025 21:25:16 -0700 |
| 63 | +Subject: [PATCH 2/3] Fix tiffmedian bug #707 |
| 64 | + |
| 65 | +--- |
| 66 | + archive/tools/tiffmedian.c | 5 ++++- |
| 67 | + 1 file changed, 4 insertions(+), 1 deletion(-) |
| 68 | + |
| 69 | +diff --git a/archive/tools/tiffmedian.c b/archive/tools/tiffmedian.c |
| 70 | +index 291e73b..b3b2671 100644 |
| 71 | +--- a/archive/tools/tiffmedian.c |
| 72 | ++++ b/archive/tools/tiffmedian.c |
| 73 | +@@ -410,7 +410,10 @@ static void get_histogram(TIFF *in, Colorbox *box) |
| 74 | + for (i = 0; i < imagelength; i++) |
| 75 | + { |
| 76 | + if (TIFFReadScanline(in, inputline, i, 0) <= 0) |
| 77 | +- break; |
| 78 | ++ { |
| 79 | ++ fprintf(stderr, "Error reading scanline\n"); |
| 80 | ++ exit(EXIT_FAILURE); |
| 81 | ++ } |
| 82 | + inptr = inputline; |
| 83 | + for (j = imagewidth; j-- > 0;) |
| 84 | + { |
| 85 | +-- |
| 86 | +2.45.4 |
| 87 | + |
| 88 | + |
| 89 | +From 0f6f0eaeefe9e98e41b96d9a47292c41e1fdf66d Mon Sep 17 00:00:00 2001 |
| 90 | +From: Lee Howard < [email protected]> |
| 91 | +Date: Sat, 24 May 2025 21:38:09 -0700 |
| 92 | +Subject: [PATCH 3/3] conflict resolution |
| 93 | + |
| 94 | +Signed-off-by: Azure Linux Security Servicing Account < [email protected]> |
| 95 | +Upstream-reference: https://gitlab.com/libtiff/libtiff/-/merge_requests/727.patch |
| 96 | +--- |
| 97 | + archive/tools/tiffmedian.c | 2 +- |
| 98 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
| 99 | + |
| 100 | +diff --git a/archive/tools/tiffmedian.c b/archive/tools/tiffmedian.c |
| 101 | +index b3b2671..3d5c9ca 100644 |
| 102 | +--- a/archive/tools/tiffmedian.c |
| 103 | ++++ b/archive/tools/tiffmedian.c |
| 104 | +@@ -915,7 +915,7 @@ static void quant_fsdither(TIFF *in, TIFF *out) |
| 105 | + outline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out)); |
| 106 | + |
| 107 | + GetInputLine(in, 0, goto bad); /* get first line */ |
| 108 | +- for (i = 0; i <= imagelength; ++i) |
| 109 | ++ for (i = 0; i < imagelength; ++i) |
| 110 | + { |
| 111 | + SWAP(short *, thisline, nextline); |
| 112 | + lastline = (i >= imax); |
| 113 | +-- |
| 114 | +2.45.4 |
| 115 | + |
0 commit comments