diff options
Diffstat (limited to 'meta/recipes-multimedia/libtiff/tiff/0001-tiffcrop-Fix-issue-330-and-some-more-from-320-to-349.patch')
| -rw-r--r-- | meta/recipes-multimedia/libtiff/tiff/0001-tiffcrop-Fix-issue-330-and-some-more-from-320-to-349.patch | 86 |
1 files changed, 42 insertions, 44 deletions
diff --git a/meta/recipes-multimedia/libtiff/tiff/0001-tiffcrop-Fix-issue-330-and-some-more-from-320-to-349.patch b/meta/recipes-multimedia/libtiff/tiff/0001-tiffcrop-Fix-issue-330-and-some-more-from-320-to-349.patch index 07acf5eb90..7c4feabc38 100644 --- a/meta/recipes-multimedia/libtiff/tiff/0001-tiffcrop-Fix-issue-330-and-some-more-from-320-to-349.patch +++ b/meta/recipes-multimedia/libtiff/tiff/0001-tiffcrop-Fix-issue-330-and-some-more-from-320-to-349.patch | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | From e319508023580e2f70e6e626f745b5b2a1707313 Mon Sep 17 00:00:00 2001 | 1 | From 0ab805f46f68500da3b49d6f89380bab169bf6bb Mon Sep 17 00:00:00 2001 |
| 2 | From: Su Laus <sulau@freenet.de> | 2 | From: Su Laus <sulau@freenet.de> |
| 3 | Date: Tue, 10 May 2022 20:03:17 +0000 | 3 | Date: Tue, 10 May 2022 20:03:17 +0000 |
| 4 | Subject: [PATCH] tiffcrop: Fix issue #330 and some more from 320 to 349 | 4 | Subject: [PATCH] tiffcrop: Fix issue #330 and some more from 320 to 349 |
| 5 | |||
| 5 | Upstream-Status: Backport | 6 | Upstream-Status: Backport |
| 6 | Signed-off-by: Zheng Qiu <zheng.qiu@windriver.com> | 7 | Signed-off-by: Zheng Qiu <zheng.qiu@windriver.com> |
| 7 | --- | 8 | --- |
| @@ -9,7 +10,7 @@ Signed-off-by: Zheng Qiu <zheng.qiu@windriver.com> | |||
| 9 | 1 file changed, 210 insertions(+), 72 deletions(-) | 10 | 1 file changed, 210 insertions(+), 72 deletions(-) |
| 10 | 11 | ||
| 11 | diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c | 12 | diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c |
| 12 | index 77cf6ed1..791ec5e7 100644 | 13 | index 99e4208..b596f9e 100644 |
| 13 | --- a/tools/tiffcrop.c | 14 | --- a/tools/tiffcrop.c |
| 14 | +++ b/tools/tiffcrop.c | 15 | +++ b/tools/tiffcrop.c |
| 15 | @@ -63,20 +63,24 @@ | 16 | @@ -63,20 +63,24 @@ |
| @@ -67,7 +68,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 67 | ; | 68 | ; |
| 68 | 69 | ||
| 69 | /* This function could be modified to pass starting sample offset | 70 | /* This function could be modified to pass starting sample offset |
| 70 | @@ -2121,6 +2131,15 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32 | 71 | @@ -2123,6 +2133,15 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32 |
| 71 | /*NOTREACHED*/ | 72 | /*NOTREACHED*/ |
| 72 | } | 73 | } |
| 73 | } | 74 | } |
| @@ -83,7 +84,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 83 | } /* end process_command_opts */ | 84 | } /* end process_command_opts */ |
| 84 | 85 | ||
| 85 | /* Start a new output file if one has not been previously opened or | 86 | /* Start a new output file if one has not been previously opened or |
| 86 | @@ -2746,7 +2765,7 @@ extractContigSamplesBytes (uint8_t *in, uint8_t *out, uint32_t cols, | 87 | @@ -2748,7 +2767,7 @@ extractContigSamplesBytes (uint8_t *in, uint8_t *out, uint32_t cols, |
| 87 | tsample_t count, uint32_t start, uint32_t end) | 88 | tsample_t count, uint32_t start, uint32_t end) |
| 88 | { | 89 | { |
| 89 | int i, bytes_per_sample, sindex; | 90 | int i, bytes_per_sample, sindex; |
| @@ -92,7 +93,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 92 | uint32_t src_byte /*, src_bit */; | 93 | uint32_t src_byte /*, src_bit */; |
| 93 | uint8_t *src = in; | 94 | uint8_t *src = in; |
| 94 | uint8_t *dst = out; | 95 | uint8_t *dst = out; |
| 95 | @@ -2757,6 +2776,10 @@ extractContigSamplesBytes (uint8_t *in, uint8_t *out, uint32_t cols, | 96 | @@ -2759,6 +2778,10 @@ extractContigSamplesBytes (uint8_t *in, uint8_t *out, uint32_t cols, |
| 96 | return (1); | 97 | return (1); |
| 97 | } | 98 | } |
| 98 | 99 | ||
| @@ -103,7 +104,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 103 | if ((start > end) || (start > cols)) | 104 | if ((start > end) || (start > cols)) |
| 104 | { | 105 | { |
| 105 | TIFFError ("extractContigSamplesBytes", | 106 | TIFFError ("extractContigSamplesBytes", |
| 106 | @@ -2769,6 +2792,9 @@ extractContigSamplesBytes (uint8_t *in, uint8_t *out, uint32_t cols, | 107 | @@ -2771,6 +2794,9 @@ extractContigSamplesBytes (uint8_t *in, uint8_t *out, uint32_t cols, |
| 107 | "Invalid end column value %"PRIu32" ignored", end); | 108 | "Invalid end column value %"PRIu32" ignored", end); |
| 108 | end = cols; | 109 | end = cols; |
| 109 | } | 110 | } |
| @@ -113,7 +114,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 113 | 114 | ||
| 114 | dst_rowsize = (bps * (end - start) * count) / 8; | 115 | dst_rowsize = (bps * (end - start) * count) / 8; |
| 115 | 116 | ||
| 116 | @@ -2812,7 +2838,7 @@ extractContigSamples8bits (uint8_t *in, uint8_t *out, uint32_t cols, | 117 | @@ -2814,7 +2840,7 @@ extractContigSamples8bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 117 | tsample_t count, uint32_t start, uint32_t end) | 118 | tsample_t count, uint32_t start, uint32_t end) |
| 118 | { | 119 | { |
| 119 | int ready_bits = 0, sindex = 0; | 120 | int ready_bits = 0, sindex = 0; |
| @@ -122,7 +123,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 122 | uint8_t maskbits = 0, matchbits = 0; | 123 | uint8_t maskbits = 0, matchbits = 0; |
| 123 | uint8_t buff1 = 0, buff2 = 0; | 124 | uint8_t buff1 = 0, buff2 = 0; |
| 124 | uint8_t *src = in; | 125 | uint8_t *src = in; |
| 125 | @@ -2824,6 +2850,10 @@ extractContigSamples8bits (uint8_t *in, uint8_t *out, uint32_t cols, | 126 | @@ -2826,6 +2852,10 @@ extractContigSamples8bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 126 | return (1); | 127 | return (1); |
| 127 | } | 128 | } |
| 128 | 129 | ||
| @@ -133,7 +134,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 133 | if ((start > end) || (start > cols)) | 134 | if ((start > end) || (start > cols)) |
| 134 | { | 135 | { |
| 135 | TIFFError ("extractContigSamples8bits", | 136 | TIFFError ("extractContigSamples8bits", |
| 136 | @@ -2836,7 +2866,10 @@ extractContigSamples8bits (uint8_t *in, uint8_t *out, uint32_t cols, | 137 | @@ -2838,7 +2868,10 @@ extractContigSamples8bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 137 | "Invalid end column value %"PRIu32" ignored", end); | 138 | "Invalid end column value %"PRIu32" ignored", end); |
| 138 | end = cols; | 139 | end = cols; |
| 139 | } | 140 | } |
| @@ -145,7 +146,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 145 | ready_bits = 0; | 146 | ready_bits = 0; |
| 146 | maskbits = (uint8_t)-1 >> (8 - bps); | 147 | maskbits = (uint8_t)-1 >> (8 - bps); |
| 147 | buff1 = buff2 = 0; | 148 | buff1 = buff2 = 0; |
| 148 | @@ -2889,7 +2922,7 @@ extractContigSamples16bits (uint8_t *in, uint8_t *out, uint32_t cols, | 149 | @@ -2891,7 +2924,7 @@ extractContigSamples16bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 149 | tsample_t count, uint32_t start, uint32_t end) | 150 | tsample_t count, uint32_t start, uint32_t end) |
| 150 | { | 151 | { |
| 151 | int ready_bits = 0, sindex = 0; | 152 | int ready_bits = 0, sindex = 0; |
| @@ -154,7 +155,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 154 | uint16_t maskbits = 0, matchbits = 0; | 155 | uint16_t maskbits = 0, matchbits = 0; |
| 155 | uint16_t buff1 = 0, buff2 = 0; | 156 | uint16_t buff1 = 0, buff2 = 0; |
| 156 | uint8_t bytebuff = 0; | 157 | uint8_t bytebuff = 0; |
| 157 | @@ -2902,6 +2935,10 @@ extractContigSamples16bits (uint8_t *in, uint8_t *out, uint32_t cols, | 158 | @@ -2904,6 +2937,10 @@ extractContigSamples16bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 158 | return (1); | 159 | return (1); |
| 159 | } | 160 | } |
| 160 | 161 | ||
| @@ -165,7 +166,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 165 | if ((start > end) || (start > cols)) | 166 | if ((start > end) || (start > cols)) |
| 166 | { | 167 | { |
| 167 | TIFFError ("extractContigSamples16bits", | 168 | TIFFError ("extractContigSamples16bits", |
| 168 | @@ -2914,6 +2951,9 @@ extractContigSamples16bits (uint8_t *in, uint8_t *out, uint32_t cols, | 169 | @@ -2916,6 +2953,9 @@ extractContigSamples16bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 169 | "Invalid end column value %"PRIu32" ignored", end); | 170 | "Invalid end column value %"PRIu32" ignored", end); |
| 170 | end = cols; | 171 | end = cols; |
| 171 | } | 172 | } |
| @@ -175,7 +176,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 175 | 176 | ||
| 176 | ready_bits = 0; | 177 | ready_bits = 0; |
| 177 | maskbits = (uint16_t)-1 >> (16 - bps); | 178 | maskbits = (uint16_t)-1 >> (16 - bps); |
| 178 | @@ -2978,7 +3018,7 @@ extractContigSamples24bits (uint8_t *in, uint8_t *out, uint32_t cols, | 179 | @@ -2980,7 +3020,7 @@ extractContigSamples24bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 179 | tsample_t count, uint32_t start, uint32_t end) | 180 | tsample_t count, uint32_t start, uint32_t end) |
| 180 | { | 181 | { |
| 181 | int ready_bits = 0, sindex = 0; | 182 | int ready_bits = 0, sindex = 0; |
| @@ -184,7 +185,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 184 | uint32_t maskbits = 0, matchbits = 0; | 185 | uint32_t maskbits = 0, matchbits = 0; |
| 185 | uint32_t buff1 = 0, buff2 = 0; | 186 | uint32_t buff1 = 0, buff2 = 0; |
| 186 | uint8_t bytebuff1 = 0, bytebuff2 = 0; | 187 | uint8_t bytebuff1 = 0, bytebuff2 = 0; |
| 187 | @@ -2991,6 +3031,10 @@ extractContigSamples24bits (uint8_t *in, uint8_t *out, uint32_t cols, | 188 | @@ -2993,6 +3033,10 @@ extractContigSamples24bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 188 | return (1); | 189 | return (1); |
| 189 | } | 190 | } |
| 190 | 191 | ||
| @@ -195,7 +196,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 195 | if ((start > end) || (start > cols)) | 196 | if ((start > end) || (start > cols)) |
| 196 | { | 197 | { |
| 197 | TIFFError ("extractContigSamples24bits", | 198 | TIFFError ("extractContigSamples24bits", |
| 198 | @@ -3003,6 +3047,9 @@ extractContigSamples24bits (uint8_t *in, uint8_t *out, uint32_t cols, | 199 | @@ -3005,6 +3049,9 @@ extractContigSamples24bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 199 | "Invalid end column value %"PRIu32" ignored", end); | 200 | "Invalid end column value %"PRIu32" ignored", end); |
| 200 | end = cols; | 201 | end = cols; |
| 201 | } | 202 | } |
| @@ -205,7 +206,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 205 | 206 | ||
| 206 | ready_bits = 0; | 207 | ready_bits = 0; |
| 207 | maskbits = (uint32_t)-1 >> (32 - bps); | 208 | maskbits = (uint32_t)-1 >> (32 - bps); |
| 208 | @@ -3087,7 +3134,7 @@ extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols, | 209 | @@ -3089,7 +3136,7 @@ extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 209 | tsample_t count, uint32_t start, uint32_t end) | 210 | tsample_t count, uint32_t start, uint32_t end) |
| 210 | { | 211 | { |
| 211 | int ready_bits = 0, sindex = 0 /*, shift_width = 0 */; | 212 | int ready_bits = 0, sindex = 0 /*, shift_width = 0 */; |
| @@ -214,7 +215,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 214 | uint32_t longbuff1 = 0, longbuff2 = 0; | 215 | uint32_t longbuff1 = 0, longbuff2 = 0; |
| 215 | uint64_t maskbits = 0, matchbits = 0; | 216 | uint64_t maskbits = 0, matchbits = 0; |
| 216 | uint64_t buff1 = 0, buff2 = 0, buff3 = 0; | 217 | uint64_t buff1 = 0, buff2 = 0, buff3 = 0; |
| 217 | @@ -3102,6 +3149,10 @@ extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols, | 218 | @@ -3104,6 +3151,10 @@ extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 218 | } | 219 | } |
| 219 | 220 | ||
| 220 | 221 | ||
| @@ -225,7 +226,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 225 | if ((start > end) || (start > cols)) | 226 | if ((start > end) || (start > cols)) |
| 226 | { | 227 | { |
| 227 | TIFFError ("extractContigSamples32bits", | 228 | TIFFError ("extractContigSamples32bits", |
| 228 | @@ -3114,6 +3165,9 @@ extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols, | 229 | @@ -3116,6 +3167,9 @@ extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 229 | "Invalid end column value %"PRIu32" ignored", end); | 230 | "Invalid end column value %"PRIu32" ignored", end); |
| 230 | end = cols; | 231 | end = cols; |
| 231 | } | 232 | } |
| @@ -235,7 +236,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 235 | 236 | ||
| 236 | /* shift_width = ((bps + 7) / 8) + 1; */ | 237 | /* shift_width = ((bps + 7) / 8) + 1; */ |
| 237 | ready_bits = 0; | 238 | ready_bits = 0; |
| 238 | @@ -3193,7 +3247,7 @@ extractContigSamplesShifted8bits (uint8_t *in, uint8_t *out, uint32_t cols, | 239 | @@ -3195,7 +3249,7 @@ extractContigSamplesShifted8bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 239 | int shift) | 240 | int shift) |
| 240 | { | 241 | { |
| 241 | int ready_bits = 0, sindex = 0; | 242 | int ready_bits = 0, sindex = 0; |
| @@ -244,7 +245,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 244 | uint8_t maskbits = 0, matchbits = 0; | 245 | uint8_t maskbits = 0, matchbits = 0; |
| 245 | uint8_t buff1 = 0, buff2 = 0; | 246 | uint8_t buff1 = 0, buff2 = 0; |
| 246 | uint8_t *src = in; | 247 | uint8_t *src = in; |
| 247 | @@ -3205,6 +3259,10 @@ extractContigSamplesShifted8bits (uint8_t *in, uint8_t *out, uint32_t cols, | 248 | @@ -3207,6 +3261,10 @@ extractContigSamplesShifted8bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 248 | return (1); | 249 | return (1); |
| 249 | } | 250 | } |
| 250 | 251 | ||
| @@ -255,7 +256,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 255 | if ((start > end) || (start > cols)) | 256 | if ((start > end) || (start > cols)) |
| 256 | { | 257 | { |
| 257 | TIFFError ("extractContigSamplesShifted8bits", | 258 | TIFFError ("extractContigSamplesShifted8bits", |
| 258 | @@ -3217,6 +3275,9 @@ extractContigSamplesShifted8bits (uint8_t *in, uint8_t *out, uint32_t cols, | 259 | @@ -3219,6 +3277,9 @@ extractContigSamplesShifted8bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 259 | "Invalid end column value %"PRIu32" ignored", end); | 260 | "Invalid end column value %"PRIu32" ignored", end); |
| 260 | end = cols; | 261 | end = cols; |
| 261 | } | 262 | } |
| @@ -265,7 +266,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 265 | 266 | ||
| 266 | ready_bits = shift; | 267 | ready_bits = shift; |
| 267 | maskbits = (uint8_t)-1 >> (8 - bps); | 268 | maskbits = (uint8_t)-1 >> (8 - bps); |
| 268 | @@ -3273,7 +3334,7 @@ extractContigSamplesShifted16bits (uint8_t *in, uint8_t *out, uint32_t cols, | 269 | @@ -3275,7 +3336,7 @@ extractContigSamplesShifted16bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 269 | int shift) | 270 | int shift) |
| 270 | { | 271 | { |
| 271 | int ready_bits = 0, sindex = 0; | 272 | int ready_bits = 0, sindex = 0; |
| @@ -274,7 +275,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 274 | uint16_t maskbits = 0, matchbits = 0; | 275 | uint16_t maskbits = 0, matchbits = 0; |
| 275 | uint16_t buff1 = 0, buff2 = 0; | 276 | uint16_t buff1 = 0, buff2 = 0; |
| 276 | uint8_t bytebuff = 0; | 277 | uint8_t bytebuff = 0; |
| 277 | @@ -3286,6 +3347,10 @@ extractContigSamplesShifted16bits (uint8_t *in, uint8_t *out, uint32_t cols, | 278 | @@ -3288,6 +3349,10 @@ extractContigSamplesShifted16bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 278 | return (1); | 279 | return (1); |
| 279 | } | 280 | } |
| 280 | 281 | ||
| @@ -285,7 +286,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 285 | if ((start > end) || (start > cols)) | 286 | if ((start > end) || (start > cols)) |
| 286 | { | 287 | { |
| 287 | TIFFError ("extractContigSamplesShifted16bits", | 288 | TIFFError ("extractContigSamplesShifted16bits", |
| 288 | @@ -3298,6 +3363,9 @@ extractContigSamplesShifted16bits (uint8_t *in, uint8_t *out, uint32_t cols, | 289 | @@ -3300,6 +3365,9 @@ extractContigSamplesShifted16bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 289 | "Invalid end column value %"PRIu32" ignored", end); | 290 | "Invalid end column value %"PRIu32" ignored", end); |
| 290 | end = cols; | 291 | end = cols; |
| 291 | } | 292 | } |
| @@ -295,7 +296,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 295 | 296 | ||
| 296 | ready_bits = shift; | 297 | ready_bits = shift; |
| 297 | maskbits = (uint16_t)-1 >> (16 - bps); | 298 | maskbits = (uint16_t)-1 >> (16 - bps); |
| 298 | @@ -3363,7 +3431,7 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, | 299 | @@ -3365,7 +3433,7 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 299 | int shift) | 300 | int shift) |
| 300 | { | 301 | { |
| 301 | int ready_bits = 0, sindex = 0; | 302 | int ready_bits = 0, sindex = 0; |
| @@ -304,7 +305,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 304 | uint32_t maskbits = 0, matchbits = 0; | 305 | uint32_t maskbits = 0, matchbits = 0; |
| 305 | uint32_t buff1 = 0, buff2 = 0; | 306 | uint32_t buff1 = 0, buff2 = 0; |
| 306 | uint8_t bytebuff1 = 0, bytebuff2 = 0; | 307 | uint8_t bytebuff1 = 0, bytebuff2 = 0; |
| 307 | @@ -3376,6 +3444,16 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, | 308 | @@ -3378,6 +3446,16 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 308 | return (1); | 309 | return (1); |
| 309 | } | 310 | } |
| 310 | 311 | ||
| @@ -321,7 +322,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 321 | if ((start > end) || (start > cols)) | 322 | if ((start > end) || (start > cols)) |
| 322 | { | 323 | { |
| 323 | TIFFError ("extractContigSamplesShifted24bits", | 324 | TIFFError ("extractContigSamplesShifted24bits", |
| 324 | @@ -3388,6 +3466,9 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, | 325 | @@ -3390,6 +3468,9 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 325 | "Invalid end column value %"PRIu32" ignored", end); | 326 | "Invalid end column value %"PRIu32" ignored", end); |
| 326 | end = cols; | 327 | end = cols; |
| 327 | } | 328 | } |
| @@ -331,7 +332,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 331 | 332 | ||
| 332 | ready_bits = shift; | 333 | ready_bits = shift; |
| 333 | maskbits = (uint32_t)-1 >> (32 - bps); | 334 | maskbits = (uint32_t)-1 >> (32 - bps); |
| 334 | @@ -3449,7 +3530,7 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, | 335 | @@ -3451,7 +3532,7 @@ extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 335 | buff2 = (buff2 << 8); | 336 | buff2 = (buff2 << 8); |
| 336 | bytebuff2 = bytebuff1; | 337 | bytebuff2 = bytebuff1; |
| 337 | ready_bits -= 8; | 338 | ready_bits -= 8; |
| @@ -340,7 +341,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 340 | 341 | ||
| 341 | return (0); | 342 | return (0); |
| 342 | } /* end extractContigSamplesShifted24bits */ | 343 | } /* end extractContigSamplesShifted24bits */ |
| 343 | @@ -3461,7 +3542,7 @@ extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols, | 344 | @@ -3463,7 +3544,7 @@ extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 344 | int shift) | 345 | int shift) |
| 345 | { | 346 | { |
| 346 | int ready_bits = 0, sindex = 0 /*, shift_width = 0 */; | 347 | int ready_bits = 0, sindex = 0 /*, shift_width = 0 */; |
| @@ -349,7 +350,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 349 | uint32_t longbuff1 = 0, longbuff2 = 0; | 350 | uint32_t longbuff1 = 0, longbuff2 = 0; |
| 350 | uint64_t maskbits = 0, matchbits = 0; | 351 | uint64_t maskbits = 0, matchbits = 0; |
| 351 | uint64_t buff1 = 0, buff2 = 0, buff3 = 0; | 352 | uint64_t buff1 = 0, buff2 = 0, buff3 = 0; |
| 352 | @@ -3476,6 +3557,10 @@ extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols, | 353 | @@ -3478,6 +3559,10 @@ extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 353 | } | 354 | } |
| 354 | 355 | ||
| 355 | 356 | ||
| @@ -360,7 +361,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 360 | if ((start > end) || (start > cols)) | 361 | if ((start > end) || (start > cols)) |
| 361 | { | 362 | { |
| 362 | TIFFError ("extractContigSamplesShifted32bits", | 363 | TIFFError ("extractContigSamplesShifted32bits", |
| 363 | @@ -3488,6 +3573,9 @@ extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols, | 364 | @@ -3490,6 +3575,9 @@ extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols, |
| 364 | "Invalid end column value %"PRIu32" ignored", end); | 365 | "Invalid end column value %"PRIu32" ignored", end); |
| 365 | end = cols; | 366 | end = cols; |
| 366 | } | 367 | } |
| @@ -370,7 +371,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 370 | 371 | ||
| 371 | /* shift_width = ((bps + 7) / 8) + 1; */ | 372 | /* shift_width = ((bps + 7) / 8) + 1; */ |
| 372 | ready_bits = shift; | 373 | ready_bits = shift; |
| 373 | @@ -5429,7 +5517,7 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt | 374 | @@ -5431,7 +5519,7 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt |
| 374 | { | 375 | { |
| 375 | struct offset offsets; | 376 | struct offset offsets; |
| 376 | int i; | 377 | int i; |
| @@ -379,7 +380,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 379 | uint32_t seg, total, need_buff = 0; | 380 | uint32_t seg, total, need_buff = 0; |
| 380 | uint32_t buffsize; | 381 | uint32_t buffsize; |
| 381 | uint32_t zwidth, zlength; | 382 | uint32_t zwidth, zlength; |
| 382 | @@ -5510,8 +5598,13 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt | 383 | @@ -5512,8 +5600,13 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt |
| 383 | seg = crop->zonelist[j].position; | 384 | seg = crop->zonelist[j].position; |
| 384 | total = crop->zonelist[j].total; | 385 | total = crop->zonelist[j].total; |
| 385 | 386 | ||
| @@ -394,7 +395,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 394 | continue; | 395 | continue; |
| 395 | } | 396 | } |
| 396 | 397 | ||
| 397 | @@ -5524,17 +5617,23 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt | 398 | @@ -5526,17 +5619,23 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt |
| 398 | 399 | ||
| 399 | crop->regionlist[i].x1 = offsets.startx + | 400 | crop->regionlist[i].x1 = offsets.startx + |
| 400 | (uint32_t)(offsets.crop_width * 1.0 * (seg - 1) / total); | 401 | (uint32_t)(offsets.crop_width * 1.0 * (seg - 1) / total); |
| @@ -428,7 +429,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 428 | zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1; | 429 | zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1; |
| 429 | 430 | ||
| 430 | /* This is passed to extractCropZone or extractCompositeZones */ | 431 | /* This is passed to extractCropZone or extractCompositeZones */ |
| 431 | @@ -5549,22 +5648,27 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt | 432 | @@ -5551,22 +5650,27 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt |
| 432 | crop->regionlist[i].x1 = offsets.startx; | 433 | crop->regionlist[i].x1 = offsets.startx; |
| 433 | crop->regionlist[i].x2 = offsets.endx; | 434 | crop->regionlist[i].x2 = offsets.endx; |
| 434 | 435 | ||
| @@ -471,7 +472,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 471 | zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1; | 472 | zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1; |
| 472 | 473 | ||
| 473 | /* This is passed to extractCropZone or extractCompositeZones */ | 474 | /* This is passed to extractCropZone or extractCompositeZones */ |
| 474 | @@ -5575,32 +5679,42 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt | 475 | @@ -5577,32 +5681,42 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt |
| 475 | crop->combined_width = (uint32_t)zwidth; | 476 | crop->combined_width = (uint32_t)zwidth; |
| 476 | break; | 477 | break; |
| 477 | case EDGE_RIGHT: /* zones from right to left, length from top */ | 478 | case EDGE_RIGHT: /* zones from right to left, length from top */ |
| @@ -539,7 +540,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 539 | case EDGE_TOP: /* width from left, zones from top to bottom */ | 540 | case EDGE_TOP: /* width from left, zones from top to bottom */ |
| 540 | default: | 541 | default: |
| 541 | zwidth = offsets.crop_width; | 542 | zwidth = offsets.crop_width; |
| 542 | @@ -5608,6 +5722,14 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt | 543 | @@ -5610,6 +5724,14 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt |
| 543 | crop->regionlist[i].x2 = offsets.endx; | 544 | crop->regionlist[i].x2 = offsets.endx; |
| 544 | 545 | ||
| 545 | crop->regionlist[i].y1 = offsets.starty + (uint32_t)(offsets.crop_length * 1.0 * (seg - 1) / total); | 546 | crop->regionlist[i].y1 = offsets.starty + (uint32_t)(offsets.crop_length * 1.0 * (seg - 1) / total); |
| @@ -554,7 +555,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 554 | test = offsets.starty + (uint32_t)(offsets.crop_length * 1.0 * seg / total); | 555 | test = offsets.starty + (uint32_t)(offsets.crop_length * 1.0 * seg / total); |
| 555 | if (test < 1 ) | 556 | if (test < 1 ) |
| 556 | crop->regionlist[i].y2 = 0; | 557 | crop->regionlist[i].y2 = 0; |
| 557 | @@ -5618,6 +5740,18 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt | 558 | @@ -5620,6 +5742,18 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt |
| 558 | else | 559 | else |
| 559 | crop->regionlist[i].y2 = test - 1; | 560 | crop->regionlist[i].y2 = test - 1; |
| 560 | } | 561 | } |
| @@ -573,7 +574,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 573 | zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1; | 574 | zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1; |
| 574 | 575 | ||
| 575 | /* This is passed to extractCropZone or extractCompositeZones */ | 576 | /* This is passed to extractCropZone or extractCompositeZones */ |
| 576 | @@ -7551,7 +7685,8 @@ processCropSelections(struct image_data *image, struct crop_mask *crop, | 577 | @@ -7543,7 +7677,8 @@ processCropSelections(struct image_data *image, struct crop_mask *crop, |
| 577 | total_width = total_length = 0; | 578 | total_width = total_length = 0; |
| 578 | for (i = 0; i < crop->selections; i++) | 579 | for (i = 0; i < crop->selections; i++) |
| 579 | { | 580 | { |
| @@ -583,7 +584,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 583 | crop_buff = seg_buffs[i].buffer; | 584 | crop_buff = seg_buffs[i].buffer; |
| 584 | if (!crop_buff) | 585 | if (!crop_buff) |
| 585 | crop_buff = (unsigned char *)limitMalloc(cropsize); | 586 | crop_buff = (unsigned char *)limitMalloc(cropsize); |
| 586 | @@ -7640,6 +7775,9 @@ processCropSelections(struct image_data *image, struct crop_mask *crop, | 587 | @@ -7632,6 +7767,9 @@ processCropSelections(struct image_data *image, struct crop_mask *crop, |
| 587 | 588 | ||
| 588 | if (crop->crop_mode & CROP_ROTATE) /* rotate should be last as it can reallocate the buffer */ | 589 | if (crop->crop_mode & CROP_ROTATE) /* rotate should be last as it can reallocate the buffer */ |
| 589 | { | 590 | { |
| @@ -593,7 +594,7 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 593 | if (rotateImage(crop->rotation, image, &crop->regionlist[i].width, | 594 | if (rotateImage(crop->rotation, image, &crop->regionlist[i].width, |
| 594 | &crop->regionlist[i].length, &crop_buff)) | 595 | &crop->regionlist[i].length, &crop_buff)) |
| 595 | { | 596 | { |
| 596 | @@ -7655,8 +7793,8 @@ processCropSelections(struct image_data *image, struct crop_mask *crop, | 597 | @@ -7647,8 +7785,8 @@ processCropSelections(struct image_data *image, struct crop_mask *crop, |
| 597 | seg_buffs[i].size = (((crop->regionlist[i].width * image->bps + 7 ) / 8) | 598 | seg_buffs[i].size = (((crop->regionlist[i].width * image->bps + 7 ) / 8) |
| 598 | * image->spp) * crop->regionlist[i].length; | 599 | * image->spp) * crop->regionlist[i].length; |
| 599 | } | 600 | } |
| @@ -604,6 +605,3 @@ index 77cf6ed1..791ec5e7 100644 | |||
| 604 | return (0); | 605 | return (0); |
| 605 | } /* end processCropSelections */ | 606 | } /* end processCropSelections */ |
| 606 | 607 | ||
| 607 | -- | ||
| 608 | 2.33.0 | ||
| 609 | |||
