mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[Editor] Pass a buffer instead of a typed array when passing image data to the model
This commit is contained in:
parent
999403f5ef
commit
d2e8e742eb
1 changed files with 3 additions and 1 deletions
|
@ -169,7 +169,9 @@ class StampEditor extends AnnotationEditor {
|
|||
const response = await mlManager.guess({
|
||||
name: "altText",
|
||||
request: {
|
||||
data,
|
||||
// Pass a buffer to avoid copy, see "run" method in:
|
||||
// https://searchfox.org/mozilla-central/source/toolkit/components/ml/actors/MLEngineParent.sys.mjs
|
||||
data: data.buffer,
|
||||
width,
|
||||
height,
|
||||
channels: data.length / (width * height),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue