refactor: correctly serialize nativeImage/buffer with typeUtils (#23666)
* refactor: correctly serialize nativeImage/buffer with typeUtils * test: add serialization specs * fix: construct from dataURL * test: test for dataURL specificity
This commit is contained in:
parent
33d6a99d40
commit
4b23a85475
4 changed files with 166 additions and 16 deletions
|
@ -41,7 +41,8 @@ function wrapArgs (args, visited = new Set()) {
|
|||
for (const scaleFactor of value.getScaleFactors()) {
|
||||
const size = value.getSize(scaleFactor);
|
||||
const buffer = value.toBitmap({ scaleFactor });
|
||||
images.push({ buffer, scaleFactor, size });
|
||||
const dataURL = value.toDataURL({ scaleFactor });
|
||||
images.push({ buffer, scaleFactor, size, dataURL });
|
||||
}
|
||||
return { type: 'nativeimage', value: images };
|
||||
} else if (Array.isArray(value)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue