Merge pull request #12922 from Snuffleupagus/getTextContent-globalImageCache
Ignore globally cached images in `PartialEvaluator.getTextContent` (PR 11930 follow-up)
This commit is contained in:
commit
e4e92d10e8
@ -2515,6 +2515,15 @@ class PartialEvaluator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const globalImage = self.globalImageCache.getData(
|
||||||
|
xobj,
|
||||||
|
self.pageIndex
|
||||||
|
);
|
||||||
|
if (globalImage) {
|
||||||
|
resolveXObject();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
xobj = xref.fetch(xobj);
|
xobj = xref.fetch(xobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,13 +247,14 @@ class GlobalImageCache {
|
|||||||
if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
|
if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!this._imageCache.has(ref)) {
|
const imageData = this._imageCache.get(ref);
|
||||||
|
if (!imageData) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// Ensure that we keep track of all pages containing the image reference.
|
// Ensure that we keep track of all pages containing the image reference.
|
||||||
pageIndexSet.add(pageIndex);
|
pageIndexSet.add(pageIndex);
|
||||||
|
|
||||||
return this._imageCache.get(ref);
|
return imageData;
|
||||||
}
|
}
|
||||||
|
|
||||||
setData(ref, data) {
|
setData(ref, data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user