Commit 98c7ce8
committed
icc improvements, especially for PSD (4644)
The main thing here is that it turns out that when trying to parse the
ICC profiles from Photoshop PSD/PSB files, we weren't storing the
attributes in the correct way. (Everything else, we shoved in both the
"common" and "composite" imagespec, but we left ICC data out of the
composite spec.)
While I'm at it, I made two other ICC related changes:
* Among the several formats with ICC profiles, we were inconsistent
about whether we report errors for corrupt ICC profiles and treat
the whole image as broken, or just ignore the errors entirely.
Fixed in various places to make a consistent policy of always
checking the errors, and reporting/terminating if the
"imageinput:strict" global attribute is true, allowing it to just
ignore the broken ICC record if that attribute is false.
* Found a spot in JPEG handling of ICC where we were dangerously
trusting of the sizes of things. Replace a risky memcpy with a safer
spancpy that can't overrun the buffer bounds when copying.
Signed-off-by: Larry Gritz <[email protected]>1 parent 280f4c9 commit 98c7ce8
File tree
6 files changed
+281
-23
lines changed- src
- jpeg.imageio
- jpeg2000.imageio
- png.imageio
- psd.imageio
- tiff.imageio
- testsuite/psd/ref
6 files changed
+281
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
432 | 437 | | |
433 | 438 | | |
434 | 439 | | |
435 | 440 | | |
436 | 441 | | |
437 | 442 | | |
438 | 443 | | |
439 | | - | |
| 444 | + | |
440 | 445 | | |
441 | 446 | | |
442 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
261 | 259 | | |
262 | 260 | | |
263 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
1248 | | - | |
1249 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
1250 | 1257 | | |
1251 | 1258 | | |
1252 | 1259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| |||
832 | 834 | | |
833 | 835 | | |
834 | 836 | | |
835 | | - | |
| 837 | + | |
| 838 | + | |
836 | 839 | | |
837 | 840 | | |
838 | 841 | | |
| |||
931 | 934 | | |
932 | 935 | | |
933 | 936 | | |
934 | | - | |
| 937 | + | |
935 | 938 | | |
936 | 939 | | |
937 | 940 | | |
| |||
1201 | 1204 | | |
1202 | 1205 | | |
1203 | 1206 | | |
1204 | | - | |
| 1207 | + | |
1205 | 1208 | | |
1206 | 1209 | | |
1207 | 1210 | | |
| |||
1239 | 1242 | | |
1240 | 1243 | | |
1241 | 1244 | | |
1242 | | - | |
1243 | | - | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1244 | 1252 | | |
1245 | 1253 | | |
1246 | 1254 | | |
| |||
1370 | 1378 | | |
1371 | 1379 | | |
1372 | 1380 | | |
| 1381 | + | |
| 1382 | + | |
1373 | 1383 | | |
1374 | 1384 | | |
1375 | 1385 | | |
| |||
0 commit comments