1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #18580 from calixteman/alt_text_pass_buffer

[Editor] Pass a buffer instead of a typed array when passing image data to the model
This commit is contained in:
calixteman 2024-08-08 14:48:27 +02:00 committed by GitHub
commit 40aa593b1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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),