Repository navigation
Conversation
|
Test data for TIFF pdfminer/pdfminer.six#1058 (review) |
|
@kvii, Thank you for this PR. It adds TIFF predictor 2 and PNG predictors 10 to 15. This change is useful. Issue 1 (must fix): The Average filter gives wrong values. Issue 2 (should fix): The new panics can stop valid PDFs. Minor:
Thanks. |
|
@ledongthuc Issue 1 is fixed. But I don't think this PR changes any behavior. YMCK(Color 4) is valid if and only if Predictor is not 1 or null. The previous code also caused a panic when Predictor was not 12 or null. Perhaps I can stop parsing other params when predictor is 1 or null, like this: func decodeParams(param Value) (predictor, rawLen, bpp int64) {
if v := param.Key("Predictor"); v.Kind() == Null {
predictor = 1
} else {
predictor = v.Int64()
}
switch predictor {
case 1:
return // <---
case 2, 10, 11, 12, 13, 14, 15:
default:
panic(fmt.Errorf("Predictor %d is currently unsupported", predictor))
}
...
switch colors {
case 1, 3:
default:
panic(fmt.Errorf("Colors %d is currently unsupported", colors))
}
...
} |
|
predictor 15 |
Fix #26
This code is inspired from pdfcpu, gopdf and image/png