mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Subtract the X/Y offsets when decoding refinement regions of JBIG2 images (issue 7145, 7308, 7401, 7850, 8270)
Please refer to the JBIG2 standard, see https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-T.88-200002-I!!PDF-E&type=items. In particular, section "6.3.5.3 Fixed templates and adaptive templates" mentions that the offsets should be *subtracted*; where the offsets are defined according to "Table 6" under section "6.3.2 Input parameters". Fixes 7145. Fixes 7308. Fixes 7401. Fixes 7850. Fixes 8270.
This commit is contained in:
parent
366277d180
commit
64deb6c700
3 changed files with 10 additions and 2 deletions
|
@ -394,8 +394,8 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||
}
|
||||
}
|
||||
for (k = 0; k < referenceTemplateLength; k++) {
|
||||
i0 = i + referenceTemplateY[k] + offsetY;
|
||||
j0 = j + referenceTemplateX[k] + offsetX;
|
||||
i0 = i + referenceTemplateY[k] - offsetY;
|
||||
j0 = j + referenceTemplateX[k] - offsetX;
|
||||
if (i0 < 0 || i0 >= referenceHeight || j0 < 0 ||
|
||||
j0 >= referenceWidth) {
|
||||
contextLabel <<= 1; // out of bound pixel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue