1/* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import image from "@ohos.multimedia.image"; 17import fileio from "@ohos.fileio"; 18import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"; 19import featureAbility from "@ohos.ability.featureAbility"; 20 21export default function imageWebp() { 22 describe("imageWebp", function () { 23 let globalpixelmap; 24 let globalImagesource; 25 let globalPacker; 26 let filePath; 27 async function getFd(fileName) { 28 let context = await featureAbility.getContext(); 29 await context.getFilesDir().then((data) => { 30 filePath = data + "/" + fileName; 31 console.info("image case filePath is " + filePath); 32 }); 33 } 34 35 beforeAll(async function () { 36 console.info("beforeAll case"); 37 }); 38 39 beforeEach(function () { 40 console.info("beforeEach case"); 41 }); 42 43 afterEach(async function () { 44 if (globalpixelmap != undefined) { 45 console.info("globalpixelmap release start"); 46 try { 47 await globalpixelmap.release(); 48 } catch (error) { 49 console.info("globalpixelmap release fail"); 50 } 51 } 52 if (globalImagesource != undefined) { 53 console.info("globalpixelmap release start"); 54 try { 55 await globalImagesource.release(); 56 } catch (error) { 57 console.info("globalImagesource release fail"); 58 } 59 } 60 if (globalPacker != undefined) { 61 console.info("globalPacker release start"); 62 try { 63 await globalPacker.release(); 64 } catch (error) { 65 console.info("globalPacker release fail"); 66 } 67 } 68 console.info("afterEach case"); 69 }); 70 71 afterAll(async function () { 72 console.info("afterAll case"); 73 }); 74 75 async function createPixMapCbErr(done, testNum, arg) { 76 await getFd("test_large.webp"); 77 let imageSourceApi = image.createImageSource(filePath); 78 if (imageSourceApi == undefined) { 79 console.info(`${testNum} create image source failed`); 80 expect(false).assertTrue(); 81 done(); 82 } else { 83 globalImagesource = imageSourceApi; 84 imageSourceApi.createPixelMap(arg, (err, pixelmap) => { 85 if (pixelmap == undefined) { 86 expect(true).assertTrue(); 87 console.info(`${testNum} success `); 88 done(); 89 } else { 90 expect(false).assertTrue(); 91 done(); 92 } 93 }); 94 } 95 } 96 97 async function createPixMapCb(done, testNum, arg) { 98 await getFd("test_large.webp"); 99 let imageSourceApi = image.createImageSource(filePath); 100 if (imageSourceApi == undefined) { 101 console.info(`${testNum} create image source failed`); 102 expect(false).assertTrue(); 103 done(); 104 } else { 105 globalImagesource = imageSourceApi; 106 imageSourceApi.createPixelMap(arg, (err, pixelmap) => { 107 if (err) { 108 console.info(`${testNum} - fail ${err}`); 109 expect(false).assertTrue(); 110 done(); 111 } else { 112 globalpixelmap = pixelmap; 113 pixelmap 114 .getImageInfo() 115 .then((imageInfo) => { 116 expect(imageInfo.size.height == 2).assertTrue(); 117 expect(imageInfo.size.width == 1).assertTrue(); 118 console.info(`${testNum} - success `); 119 console.info( 120 "imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width 121 ); 122 done(); 123 }) 124 .catch((err) => { 125 console.info(`${testNum} getimageInfo err ` + JSON.stringify(err)); 126 }); 127 } 128 }); 129 } 130 } 131 async function createPixMapPromiseErr(done, testNum, arg) { 132 await getFd("test_large.webp"); 133 let imageSourceApi = image.createImageSource(filePath); 134 if (imageSourceApi == undefined) { 135 console.info(`${testNum} create image source failed`); 136 expect(false).assertTrue(); 137 done(); 138 } else { 139 globalImagesource = imageSourceApi; 140 imageSourceApi 141 .createPixelMap(arg) 142 .then((pixelmap) => { 143 console.log(`${testNum} failed`); 144 expect().assertFail(); 145 done(); 146 }) 147 .catch((error) => { 148 console.log(`${testNum} success `); 149 expect(true).assertTrue(); 150 done(); 151 }); 152 } 153 } 154 async function createPixMapPromise(done, testNum, arg) { 155 await getFd("test_large.webp"); 156 let imageSourceApi = image.createImageSource(filePath); 157 if (imageSourceApi == undefined) { 158 console.info(`${testNum} create image source failed`); 159 expect(false).assertTrue(); 160 done(); 161 } else { 162 globalImagesource = imageSourceApi; 163 imageSourceApi 164 .createPixelMap(arg) 165 .then((pixelmap) => { 166 globalpixelmap = pixelmap; 167 pixelmap 168 .getImageInfo() 169 .then((imageInfo) => { 170 expect(imageInfo.size.height == 2).assertTrue(); 171 expect(imageInfo.size.width == 1).assertTrue(); 172 console.info(`${testNum} - success `); 173 console.info( 174 "imageInfo height :" + imageInfo.size.height + "width : " + imageInfo.size.width 175 ); 176 done(); 177 }) 178 .catch((err) => { 179 console.info(`${testNum} getimageInfo err ` + JSON.stringify(err)); 180 }); 181 }) 182 .catch((error) => { 183 console.log(`${testNum} fail `); 184 expect(flase).assertTrue(); 185 done(); 186 }); 187 } 188 } 189 async function packingPromise(done, testNum, arg) { 190 console.info(`${testNum} enter`); 191 var height = 4; 192 var width = 6; 193 var pixelSize = 4; 194 var widthSize = width * pixelSize; 195 var bufferSize = height * widthSize; 196 const color = new ArrayBuffer(bufferSize); 197 var colorArr = new Uint8Array(color); 198 for (var h = 0; h < height / 2; h++) { 199 for (var w = 0; w < width / 2; w++) { 200 var pos = widthSize * h + pixelSize * w; 201 colorArr[pos + 0] = 255; // r 202 colorArr[pos + 1] = 0; 203 colorArr[pos + 2] = 0; 204 colorArr[pos + 3] = 255; 205 } 206 } 207 for (var h = 0; h < height / 2; h++) { 208 for (var w = width / 2; w < width; w++) { 209 var pos = widthSize * h + pixelSize * w; 210 colorArr[pos + 0] = 0; 211 colorArr[pos + 1] = 255; // g 212 colorArr[pos + 2] = 0; 213 colorArr[pos + 3] = 255; 214 } 215 } 216 for (var h = height / 2; h < height; h++) { 217 for (var w = 0; w < width / 2; w++) { 218 var pos = widthSize * h + pixelSize * w; 219 colorArr[pos + 0] = 0; 220 colorArr[pos + 1] = 0; 221 colorArr[pos + 2] = 255; // b 222 colorArr[pos + 3] = 255; 223 } 224 } 225 for (var h = height / 2; h < height; h++) { 226 for (var w = width / 2; w < width; w++) { 227 var pos = widthSize * h + pixelSize * w; 228 colorArr[pos + 0] = 0; 229 colorArr[pos + 1] = 0; 230 colorArr[pos + 2] = 0; 231 colorArr[pos + 3] = 255; 232 } 233 } 234 235 let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }; 236 image.createPixelMap(color, opts).then((pixelmap) => { 237 if (pixelmap == undefined) { 238 console.info("${testNum} create pixelmap failed"); 239 expect(false).assertTrue(); 240 done(); 241 } else { 242 globalpixelmap = pixelmap; 243 const imagePackerApi = image.createImagePacker(); 244 if (imagePackerApi == undefined) { 245 console.info(`${testNum} create image packer failed`); 246 expect(false).assertTrue(); 247 done(); 248 } else { 249 globalPacker = imagePackerApi; 250 imagePackerApi 251 .packing(pixelmap, arg) 252 .then((data) => { 253 console.info(`${testNum} success`); 254 expect(data != undefined).assertTrue(); 255 var dataArr = new Uint8Array(data); 256 console.info(`${testNum} dataArr.length=` + dataArr.length); 257 for (var i = 0; i < dataArr.length; i++) { 258 console.info(`dataArr[` + i + `]=` + dataArr[i]); 259 } 260 done(); 261 }) 262 .catch((error) => { 263 console.log(`${testNum} error: ` + error); 264 expect(false).assertFail(); 265 done(); 266 }); 267 } 268 } 269 }); 270 console.info(`${testNum} leave`); 271 } 272 273 async function packingCb(done, testNum, arg) { 274 console.info(`${testNum} enter`); 275 var height = 4; 276 var width = 6; 277 var pixelSize = 4; 278 var widthSize = width * pixelSize; 279 var bufferSize = height * widthSize; 280 const color = new ArrayBuffer(bufferSize); 281 var colorArr = new Uint8Array(color); 282 for (var h = 0; h < height / 2; h++) { 283 for (var w = 0; w < width / 2; w++) { 284 var pos = widthSize * h + pixelSize * w; 285 colorArr[pos + 0] = 255; // r 286 colorArr[pos + 1] = 0; 287 colorArr[pos + 2] = 0; 288 colorArr[pos + 3] = 255; 289 } 290 } 291 for (var h = 0; h < height / 2; h++) { 292 for (var w = width / 2; w < width; w++) { 293 var pos = widthSize * h + pixelSize * w; 294 colorArr[pos + 0] = 0; 295 colorArr[pos + 1] = 255; // g 296 colorArr[pos + 2] = 0; 297 colorArr[pos + 3] = 255; 298 } 299 } 300 for (var h = height / 2; h < height; h++) { 301 for (var w = 0; w < width / 2; w++) { 302 var pos = widthSize * h + pixelSize * w; 303 colorArr[pos + 0] = 0; 304 colorArr[pos + 1] = 0; 305 colorArr[pos + 2] = 255; // b 306 colorArr[pos + 3] = 255; 307 } 308 } 309 for (var h = height / 2; h < height; h++) { 310 for (var w = width / 2; w < width; w++) { 311 var pos = widthSize * h + pixelSize * w; 312 colorArr[pos + 0] = 0; 313 colorArr[pos + 1] = 0; 314 colorArr[pos + 2] = 0; 315 colorArr[pos + 3] = 255; 316 } 317 } 318 319 let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }; 320 image 321 .createPixelMap(color, opts) 322 .then((pixelmap) => { 323 if (pixelmap == undefined) { 324 console.info("${testNum} create pixelmap failed"); 325 expect(false).assertTrue(); 326 done(); 327 } else { 328 globalpixelmap = pixelmap; 329 const imagePackerApi = image.createImagePacker(); 330 if (imagePackerApi == undefined) { 331 console.info(`${testNum} create image packer failed`); 332 expect(false).assertTrue(); 333 done(); 334 } else { 335 globalPacker = imagePackerApi; 336 imagePackerApi.packing(pixelmap, arg, (err, data) => { 337 console.info(`${testNum} success`); 338 expect(data != undefined).assertTrue(); 339 var dataArr = new Uint8Array(data); 340 console.info(`${testNum} dataArr.length=` + dataArr.length); 341 for (var i = 0; i < dataArr.length; i++) { 342 console.info(`dataArr[` + i + `]=` + dataArr[i]); 343 } 344 done(); 345 }); 346 } 347 } 348 }) 349 .catch((error) => { 350 console.log(`${testNum} error: ` + error); 351 expect(false).assertFail(); 352 done(); 353 }); 354 console.info(`${testNum} leave`); 355 } 356 357 async function packingPromiseErr(done, testNum, arg) { 358 console.info(`${testNum} enter`); 359 var height = 4; 360 var width = 6; 361 var pixelSize = 4; 362 var widthSize = width * pixelSize; 363 var bufferSize = height * widthSize; 364 const color = new ArrayBuffer(bufferSize); 365 var colorArr = new Uint8Array(color); 366 for (var h = 0; h < height / 2; h++) { 367 for (var w = 0; w < width / 2; w++) { 368 var pos = widthSize * h + pixelSize * w; 369 colorArr[pos + 0] = 255; // r 370 colorArr[pos + 1] = 0; 371 colorArr[pos + 2] = 0; 372 colorArr[pos + 3] = 255; 373 } 374 } 375 for (var h = 0; h < height / 2; h++) { 376 for (var w = width / 2; w < width; w++) { 377 var pos = widthSize * h + pixelSize * w; 378 colorArr[pos + 0] = 0; 379 colorArr[pos + 1] = 255; // g 380 colorArr[pos + 2] = 0; 381 colorArr[pos + 3] = 255; 382 } 383 } 384 for (var h = height / 2; h < height; h++) { 385 for (var w = 0; w < width / 2; w++) { 386 var pos = widthSize * h + pixelSize * w; 387 colorArr[pos + 0] = 0; 388 colorArr[pos + 1] = 0; 389 colorArr[pos + 2] = 255; // b 390 colorArr[pos + 3] = 255; 391 } 392 } 393 for (var h = height / 2; h < height; h++) { 394 for (var w = width / 2; w < width; w++) { 395 var pos = widthSize * h + pixelSize * w; 396 colorArr[pos + 0] = 0; 397 colorArr[pos + 1] = 0; 398 colorArr[pos + 2] = 0; 399 colorArr[pos + 3] = 255; 400 } 401 } 402 403 let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }; 404 image.createPixelMap(color, opts).then((pixelmap) => { 405 if (pixelmap == undefined) { 406 console.info("${testNum} create pixelmap failed"); 407 expect(false).assertTrue(); 408 done(); 409 } else { 410 globalpixelmap = pixelmap; 411 const imagePackerApi = image.createImagePacker(); 412 if (imagePackerApi == undefined) { 413 console.info(`${testNum} create image packer failed`); 414 expect(false).assertTrue(); 415 done(); 416 } else { 417 globalPacker = imagePackerApi; 418 imagePackerApi 419 .packing(pixelmap, arg) 420 .then((data) => { 421 expect(data == undefined).assertTrue(); 422 done(); 423 }) 424 .catch((error) => { 425 console.log(`${testNum} error: ` + error); 426 expect(true).assertTrue(); 427 done(); 428 }); 429 } 430 } 431 }); 432 console.info(`${testNum} leave`); 433 } 434 435 async function packingCbErr(done, testNum, arg) { 436 console.info(`${testNum} enter`); 437 var height = 4; 438 var width = 6; 439 var pixelSize = 4; 440 var widthSize = width * pixelSize; 441 var bufferSize = height * widthSize; 442 const color = new ArrayBuffer(bufferSize); 443 var colorArr = new Uint8Array(color); 444 for (var h = 0; h < height / 2; h++) { 445 for (var w = 0; w < width / 2; w++) { 446 var pos = widthSize * h + pixelSize * w; 447 colorArr[pos + 0] = 255; // r 448 colorArr[pos + 1] = 0; 449 colorArr[pos + 2] = 0; 450 colorArr[pos + 3] = 255; 451 } 452 } 453 for (var h = 0; h < height / 2; h++) { 454 for (var w = width / 2; w < width; w++) { 455 var pos = widthSize * h + pixelSize * w; 456 colorArr[pos + 0] = 0; 457 colorArr[pos + 1] = 255; // g 458 colorArr[pos + 2] = 0; 459 colorArr[pos + 3] = 255; 460 } 461 } 462 for (var h = height / 2; h < height; h++) { 463 for (var w = 0; w < width / 2; w++) { 464 var pos = widthSize * h + pixelSize * w; 465 colorArr[pos + 0] = 0; 466 colorArr[pos + 1] = 0; 467 colorArr[pos + 2] = 255; // b 468 colorArr[pos + 3] = 255; 469 } 470 } 471 for (var h = height / 2; h < height; h++) { 472 for (var w = width / 2; w < width; w++) { 473 var pos = widthSize * h + pixelSize * w; 474 colorArr[pos + 0] = 0; 475 colorArr[pos + 1] = 0; 476 colorArr[pos + 2] = 0; 477 colorArr[pos + 3] = 255; 478 } 479 } 480 481 let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }; 482 image 483 .createPixelMap(color, opts) 484 .then((pixelmap) => { 485 if (pixelmap == undefined) { 486 console.info("${testNum} create pixelmap failed"); 487 expect(false).assertTrue(); 488 done(); 489 } else { 490 globalpixelmap = pixelmap; 491 const imagePackerApi = image.createImagePacker(); 492 if (imagePackerApi == undefined) { 493 console.info(`${testNum} create image packer failed`); 494 expect(false).assertTrue(); 495 done(); 496 } else { 497 globalPacker = imagePackerApi; 498 imagePackerApi.packing(pixelmap, arg, (err, data) => { 499 console.info(`${testNum} success`); 500 expect(data == undefined).assertTrue(); 501 done(); 502 }); 503 } 504 } 505 }) 506 .catch((error) => { 507 console.log(`${testNum} error: ` + error); 508 expect(true).assertTrue(); 509 done(); 510 }); 511 console.info(`${testNum} leave`); 512 } 513 514 /** 515 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0100 516 * @tc.name : createPixelMap - promise-webp 517 * @tc.desc : 1.create imagesource 518 * 2.set index and DecodeOptions 519 * 3.create PixelMap 520 * 4.return pixelmap 521 * @tc.size : MEDIUM 522 * @tc.type : Functional 523 * @tc.level : Level 1 524 */ 525 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0100", 0, async function (done) { 526 try { 527 await getFd("test_large.webp"); 528 let imageSourceApi = image.createImageSource(filePath); 529 if (imageSourceApi == undefined) { 530 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0100 create image source failed"); 531 expect(false).assertTrue(); 532 done(); 533 } else { 534 globalImagesource = imageSourceApi; 535 let decodingOptions = { 536 sampleSize: 1, 537 editable: true, 538 desiredSize: { width: 1, height: 2 }, 539 rotate: 10, 540 desiredPixelFormat: 2, 541 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 542 index: 0, 543 }; 544 545 imageSourceApi.createPixelMap(decodingOptions).then((pixelmap) => { 546 if (pixelmap != undefined) { 547 globalpixelmap = pixelmap; 548 expect(true).assertTrue(); 549 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0100 success "); 550 done(); 551 } else { 552 expect(false).assertTrue(); 553 done(); 554 } 555 }); 556 } 557 } catch (error) { 558 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0100 error: " + error); 559 expect(false).assertTrue(); 560 done(); 561 } 562 }); 563 564 /** 565 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0100 566 * @tc.name : createPixelMap - callback-webp 567 * @tc.desc : 1.create imagesource 568 * 2.set index and DecodeOptions 569 * 3.create PixelMap 570 * 4.return pixelmap 571 * @tc.size : MEDIUM 572 * @tc.type : Functional 573 * @tc.level : Level 1 574 */ 575 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0100", 0, async function (done) { 576 try { 577 await getFd("test_large.webp"); 578 let imageSourceApi = image.createImageSource(filePath); 579 if (imageSourceApi == undefined) { 580 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0100 create image source failed"); 581 expect(false).assertTrue(); 582 done(); 583 } else { 584 globalImagesource = imageSourceApi; 585 let decodingOptions = { 586 sampleSize: 1, 587 editable: true, 588 desiredSize: { width: 1, height: 2 }, 589 rotate: 10, 590 desiredPixelFormat: 2, 591 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 592 index: 0, 593 }; 594 595 imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => { 596 if (pixelmap != undefined) { 597 globalpixelmap = pixelmap; 598 expect(true).assertTrue(); 599 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0100 success "); 600 done(); 601 } else { 602 expect(false).assertTrue(); 603 done(); 604 } 605 }); 606 } 607 } catch (error) { 608 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0100 error: " + error); 609 expect(false).assertTrue(); 610 done(); 611 } 612 }); 613 614 /** 615 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0200 616 * @tc.name : createPixelMap-promise-webp 617 * @tc.desc : 1.create imagesource 618 * 2.set index and DecodeOptions 619 * 3.create PixelMap 620 * 4.return pixelmap 621 * @tc.size : MEDIUM 622 * @tc.type : Functional 623 * @tc.level : Level 1 624 */ 625 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0200", 0, async function (done) { 626 try { 627 await getFd("test_large.webp"); 628 let imageSourceApi = image.createImageSource(filePath); 629 if (imageSourceApi == undefined) { 630 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0200 create image source failed"); 631 expect(false).assertTrue(); 632 done(); 633 } else { 634 globalImagesource = imageSourceApi; 635 imageSourceApi 636 .createPixelMap() 637 .then((pixelmap) => { 638 globalpixelmap = pixelmap; 639 expect(pixelmap != undefined).assertTrue(); 640 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0200 success "); 641 done(); 642 }) 643 .catch((error) => { 644 console.log("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0200 error: " + error); 645 expect().assertFail(); 646 done(); 647 }); 648 } 649 } catch (error) { 650 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_PROMISE_0200 err " + error); 651 } 652 }); 653 654 /** 655 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0200 656 * @tc.name : createPixelMap-callback-webp 657 * @tc.desc : 1.create imagesource 658 * 2.set index and DecodeOptions 659 * 3.create PixelMap 660 * 4.return pixelmap 661 * @tc.size : MEDIUM 662 * @tc.type : Functional 663 * @tc.level : Level 1 664 */ 665 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0200", 0, async function (done) { 666 try { 667 await getFd("test_large.webp"); 668 let imageSourceApi = image.createImageSource(filePath); 669 if (imageSourceApi == undefined) { 670 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0200 create image source failed"); 671 expect(false).assertTrue(); 672 done(); 673 } else { 674 globalImagesource = imageSourceApi; 675 imageSourceApi.createPixelMap((err, pixelmap) => { 676 globalpixelmap = pixelmap; 677 expect(pixelmap != undefined).assertTrue(); 678 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0200 success "); 679 done(); 680 }); 681 } 682 } catch (error) { 683 console.info("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0200 err " + error); 684 } 685 }); 686 687 /** 688 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0300 689 * @tc.name : createPixelMap-callback -{sampleSize: -1} -webp 690 * @tc.desc : 1.create imagesource 691 * 2.set index and DecodeOptions 692 * 3.create PixelMap 693 * 4.return pixelmap undefined 694 * @tc.size : MEDIUM 695 * @tc.type : Functional 696 * @tc.level : Level 1 697 */ 698 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0300", 0, async function (done) { 699 let decodingOptions = { 700 sampleSize: -1, 701 editable: true, 702 desiredSize: { width: 1, height: 2 }, 703 rotate: 10, 704 desiredPixelFormat: 2, 705 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 706 index: 0, 707 }; 708 createPixMapCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0300", decodingOptions); 709 }); 710 711 /** 712 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0400 713 * @tc.name : createPixelMap-callback -{index: -1} -webp 714 * @tc.desc : 1.create imagesource 715 * 2.set index and DecodeOptions 716 * 3.create PixelMap 717 * 4.return pixelmap undefined 718 * @tc.size : MEDIUM 719 * @tc.type : Functional 720 * @tc.level : Level 1 721 */ 722 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0400", 0, async function (done) { 723 let decodingOptions = { 724 sampleSize: 1, 725 editable: true, 726 desiredSize: { width: 1, height: 2 }, 727 rotate: 10, 728 desiredPixelFormat: 0, 729 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 730 index: -1, 731 }; 732 createPixMapCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0400", decodingOptions); 733 }); 734 735 /** 736 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0500 737 * @tc.name : createPixelMap-callback -{rotate: 500} -webp 738 * @tc.desc : 1.create imagesource 739 * 2.set index and DecodeOptions 740 * 3.create PixelMap 741 * 4.return pixelmap undefined 742 * @tc.size : MEDIUM 743 * @tc.type : Functional 744 * @tc.level : Level 1 745 */ 746 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0500", 0, async function (done) { 747 let decodingOptions = { 748 sampleSize: 1, 749 editable: true, 750 desiredSize: { width: 1, height: 2 }, 751 rotate: 500, 752 desiredPixelFormat: 3, 753 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 754 index: 0, 755 }; 756 createPixMapCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0500", decodingOptions); 757 }); 758 759 /** 760 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0600 761 * @tc.name : createPixelMap-callback -{rotate: -10} -webp 762 * @tc.desc : 1.create imagesource 763 * 2.set index and DecodeOptions 764 * 3.create PixelMap 765 * 4.return pixelmap undefined 766 * @tc.size : MEDIUM 767 * @tc.type : Functional 768 * @tc.level : Level 1 769 */ 770 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0600", 0, async function (done) { 771 let decodingOptions = { 772 sampleSize: 1, 773 editable: true, 774 desiredSize: { width: 1, height: 2 }, 775 rotate: -10, 776 desiredPixelFormat: 3, 777 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 778 index: 0, 779 }; 780 createPixMapCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0600", decodingOptions); 781 }); 782 783 /** 784 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0700 785 * @tc.name : createPixelMap-callback editable: false -webp 786 * @tc.desc : 1.create imagesource 787 * 2.set index and DecodeOptions 788 * 3.create PixelMap 789 * 4.return pixelmap undefined 790 * @tc.size : MEDIUM 791 * @tc.type : Functional 792 * @tc.level : Level 1 793 */ 794 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0700", 0, async function (done) { 795 let decodingOptions = { 796 sampleSize: 1, 797 editable: false, 798 desiredSize: { width: 1, height: 2 }, 799 rotate: 10, 800 desiredPixelFormat: 33, 801 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 802 index: 0, 803 }; 804 createPixMapCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0700", decodingOptions); 805 }); 806 807 /** 808 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0800 809 * @tc.name : createPixelMap-callback -{ size: { height: 1, width: 2 }, x: -1, y: -1 }-webp 810 * @tc.desc : 1.create imagesource 811 * 2.set index and DecodeOptions 812 * 3.create PixelMap 813 * 4.return pixelmap undefined 814 * @tc.size : MEDIUM 815 * @tc.type : Functional 816 * @tc.level : Level 1 817 */ 818 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0800", 0, async function (done) { 819 let decodingOptions = { 820 sampleSize: 1, 821 editable: true, 822 desiredSize: { width: 1, height: 2 }, 823 rotate: 10, 824 desiredPixelFormat: 2, 825 desiredRegion: { size: { height: 1, width: 2 }, x: -1, y: -1 }, 826 index: 0, 827 }; 828 createPixMapCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0800", decodingOptions); 829 }); 830 831 /** 832 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0900 833 * @tc.name : createPixelMap-callback -size: { height: 10000, width: 10000 } -webp 834 * @tc.desc : 1.create imagesource 835 * 2.set index and DecodeOptions 836 * 3.create PixelMap 837 * 4.return pixelmap undefined 838 * @tc.size : MEDIUM 839 * @tc.type : Functional 840 * @tc.level : Level 1 841 */ 842 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0900", 0, async function (done) { 843 let decodingOptions = { 844 sampleSize: 1, 845 editable: true, 846 desiredSize: { width: 1, height: 2 }, 847 rotate: 10, 848 desiredPixelFormat: 3, 849 desiredRegion: { size: { height: 10000, width: 10000 }, x: 0, y: 0 }, 850 index: 0, 851 }; 852 createPixMapCb(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_0900", decodingOptions); 853 }); 854 855 /** 856 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1000 857 * @tc.name : createPixelMap-callback - sampleSize: -1 -webp 858 * @tc.desc : 1.create imagesource 859 * 2.set index and DecodeOptions 860 * 3.create PixelMap 861 * 4.return pixelmap undefined 862 * @tc.size : MEDIUM 863 * @tc.type : Functional 864 * @tc.level : Level 1 865 */ 866 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1000", 0, async function (done) { 867 let decodingOptions = { 868 sampleSize: -1, 869 editable: true, 870 desiredSize: { width: 1, height: 2 }, 871 rotate: 10, 872 desiredPixelFormat: 2, 873 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 874 index: 0, 875 }; 876 createPixMapPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1000", decodingOptions); 877 }); 878 879 /** 880 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1100 881 * @tc.name : createPixelMap-callback - index: -1 -webp 882 * @tc.desc : 1.create imagesource 883 * 2.set index and DecodeOptions 884 * 3.create PixelMap 885 * 4.return pixelmap undefined 886 * @tc.size : MEDIUM 887 * @tc.type : Functional 888 * @tc.level : Level 1 889 */ 890 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1100", 0, async function (done) { 891 let decodingOptions = { 892 sampleSize: 1, 893 editable: true, 894 desiredSize: { width: 1, height: 2 }, 895 rotate: 10, 896 desiredPixelFormat: 2, 897 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 898 index: -1, 899 }; 900 createPixMapPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1100", decodingOptions); 901 }); 902 903 /** 904 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1200 905 * @tc.name : createPixelMap-callback - desiredPixelFormat: 1 -webp 906 * @tc.desc : 1.create imagesource 907 * 2.set index and DecodeOptions 908 * 3.create PixelMap 909 * 4.return pixelmap undefined 910 * @tc.size : MEDIUM 911 * @tc.type : Functional 912 * @tc.level : Level 1 913 */ 914 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1200", 0, async function (done) { 915 let decodingOptions = { 916 sampleSize: 2, 917 editable: true, 918 desiredSize: { width: 1, height: 2 }, 919 rotate: 500, 920 desiredPixelFormat: 1, 921 desiredRegion: { size: { height: 1, width: 2 }, x: 0, y: 0 }, 922 index: 0, 923 }; 924 createPixMapPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1200", decodingOptions); 925 }); 926 927 /** 928 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1300 929 * @tc.name : createPixelMap-callback - { size: { height: 1, width: 2 }, x: -1, y: -1 } -webp 930 * @tc.desc : 1.create imagesource 931 * 2.set index and DecodeOptions 932 * 3.create PixelMap 933 * 4.return pixelmap undefined 934 * @tc.size : MEDIUM 935 * @tc.type : Functional 936 * @tc.level : Level 1 937 */ 938 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1300", 0, async function (done) { 939 let decodingOptions = { 940 sampleSize: 1, 941 editable: true, 942 desiredSize: { width: 1, height: 2 }, 943 rotate: 10, 944 desiredPixelFormat: 3, 945 desiredRegion: { size: { height: 1, width: 2 }, x: -1, y: -1 }, 946 index: 0, 947 }; 948 createPixMapPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1300", decodingOptions); 949 }); 950 951 /** 952 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1400 953 * @tc.name : createPixelMap-callback - size: { height: 10000, width:10000 } -webp 954 * @tc.desc : 1.create imagesource 955 * 2.set index and DecodeOptions 956 * 3.create PixelMap 957 * 4.return pixelmap undefined 958 * @tc.size : MEDIUM 959 * @tc.type : Functional 960 * @tc.level : Level 1 961 */ 962 it("SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1400", 0, async function (done) { 963 let decodingOptions = { 964 sampleSize: 1, 965 editable: true, 966 desiredSize: { width: 1, height: 2 }, 967 rotate: 10, 968 desiredPixelFormat: 2, 969 desiredRegion: { size: { height: 10000, width: 10000 }, x: 0, y: 0 }, 970 index: 0, 971 }; 972 createPixMapPromise(done, "SUB_GRAPHIC_IMAGE_WEBP_CREATEPIXELMAP_CALLBACK_1400", decodingOptions); 973 }); 974 975 /** 976 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_0100 977 * @tc.name : packing - callback-webp 978 * @tc.desc : 1.create ImageSource 979 * 2.call packing 980 * 3.return array 981 * @tc.size : MEDIUM 982 * @tc.type : Functional 983 * @tc.level : Level 1 984 */ 985 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_0100", 0, async function (done) { 986 let packOpts = { format: ["image/webp"], quality: 90 }; 987 packingCb(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_0100", packOpts); 988 }); 989 990 /** 991 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_0100 992 * @tc.name : packing - promise-webp 993 * @tc.desc : 1.create ImageSource 994 * 2.call packing 995 * 3.return array 996 * @tc.size : MEDIUM 997 * @tc.type : Functional 998 * @tc.level : Level 1 999 */ 1000 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_0100", 0, async function (done) { 1001 let packOpts = { format: ["image/webp"], quality: 100 }; 1002 packingPromise(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_0100", packOpts); 1003 }); 1004 1005 /** 1006 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0100 1007 * @tc.name : packing - promise-webp-wrong quality 1008 * @tc.desc : 1.create ImageSource 1009 * 2.call packing 1010 * 3.return array 1011 * @tc.size : MEDIUM 1012 * @tc.type : Functional 1013 * @tc.level : Level 1 1014 */ 1015 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0100", 0, async function (done) { 1016 let packOpts = { format: ["image/webp"], quality: 123 }; 1017 packingPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0100", packOpts); 1018 }); 1019 1020 /** 1021 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0200 1022 * @tc.name : packing - promise-webp 1023 * @tc.desc : 1.create ImageSource 1024 * 2.call packing 1025 * 3.return array 1026 * @tc.size : MEDIUM 1027 * @tc.type : Functional 1028 * @tc.level : Level 1 1029 */ 1030 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0200", 0, async function (done) { 1031 let packOpts = { format: ["image/gif"], quality: 90 }; 1032 packingPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0200", packOpts); 1033 }); 1034 1035 /** 1036 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0300 1037 * @tc.name : packing - promise-webp-no format 1038 * @tc.desc : 1.create ImageSource 1039 * 2.call packing 1040 * 3.return array 1041 * @tc.size : MEDIUM 1042 * @tc.type : Functional 1043 * @tc.level : Level 1 1044 */ 1045 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0300", 0, async function (done) { 1046 let packOpts = { quality: 90 }; 1047 packingPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0300", packOpts); 1048 }); 1049 1050 /** 1051 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0400 1052 * @tc.name : packing - promise-webp-no format 1053 * @tc.desc : 1.create ImageSource 1054 * 2.call packing 1055 * 3.return array 1056 * @tc.size : MEDIUM 1057 * @tc.type : Functional 1058 * @tc.level : Level 1 1059 */ 1060 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0400", 0, async function (done) { 1061 let packOpts = { format: ["image/jpeg"] }; 1062 packingPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0400", packOpts); 1063 }); 1064 1065 /** 1066 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0100 1067 * @tc.name : packing - callback-webp-wrong format 1068 * @tc.desc : 1.create ImageSource 1069 * 2.call packing 1070 * 3.return array 1071 * @tc.size : MEDIUM 1072 * @tc.type : Functional 1073 * @tc.level : Level 1 1074 */ 1075 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0100", 0, async function (done) { 1076 let packOpts = { format: ["image/gif"], quality: 100 }; 1077 packingCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0100", packOpts); 1078 }); 1079 1080 /** 1081 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0200 1082 * @tc.name : packing - callback-webp-wrong quality 1083 * @tc.desc : 1.create ImageSource 1084 * 2.call packing 1085 * 3.return array 1086 * @tc.size : MEDIUM 1087 * @tc.type : Functional 1088 * @tc.level : Level 1 1089 */ 1090 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0200", 0, async function (done) { 1091 let packOpts = { format: ["image/jpeg"], quality: 112 }; 1092 packingCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0200", packOpts); 1093 }); 1094 1095 /** 1096 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0300 1097 * @tc.name : packing - callback-webp-no quality 1098 * @tc.desc : 1.create ImageSource 1099 * 2.call packing 1100 * 3.return array 1101 * @tc.size : MEDIUM 1102 * @tc.type : Functional 1103 * @tc.level : Level 1 1104 */ 1105 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0300", 0, async function (done) { 1106 let packOpts = { format: ["image/jpeg"] }; 1107 packingCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0300", packOpts); 1108 }); 1109 1110 /** 1111 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0400 1112 * @tc.name : packing - callback-webp-no format 1113 * @tc.desc : 1.create ImageSource 1114 * 2.call packing 1115 * 3.return array 1116 * @tc.size : MEDIUM 1117 * @tc.type : Functional 1118 * @tc.level : Level 1 1119 */ 1120 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0400", 0, async function (done) { 1121 let packOpts = { quality: 90 }; 1122 packingCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0400", packOpts); 1123 }); 1124 1125 /** 1126 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0500 1127 * @tc.name : packing - callback-webp-quality -1 1128 * @tc.desc : 1.create ImageSource 1129 * 2.call packing 1130 * 3.return array 1131 * @tc.size : MEDIUM 1132 * @tc.type : Functional 1133 * @tc.level : Level 1 1134 */ 1135 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0500", 0, async function (done) { 1136 let packOpts = { format: ["image/jpeg"], quality: -1 }; 1137 packingCbErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_ERROR_0500", packOpts); 1138 }); 1139 1140 /** 1141 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0500 1142 * @tc.name : packing - promise-webp-quality -1 1143 * @tc.desc : 1.create ImageSource 1144 * 2.call packing 1145 * 3.return array 1146 * @tc.size : MEDIUM 1147 * @tc.type : Functional 1148 * @tc.level : Level 1 1149 */ 1150 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0500", 0, async function (done) { 1151 let packOpts = { format: ["image/jpeg"], quality: -1 }; 1152 packingPromiseErr(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_ERROR_0500", packOpts); 1153 }); 1154 1155 /** 1156 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_0200 1157 * @tc.name : packing - callback-webp-quality 0 1158 * @tc.desc : 1.create ImageSource 1159 * 2.call packing 1160 * 3.return array 1161 * @tc.size : MEDIUM 1162 * @tc.type : Functional 1163 * @tc.level : Level 1 1164 */ 1165 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_0200", 0, async function (done) { 1166 let packOpts = { format: ["image/jpeg"], quality: 0 }; 1167 packingCb(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_CALLBACK_0200", packOpts); 1168 }); 1169 1170 /** 1171 * @tc.number : SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_0200 1172 * @tc.name : packing - promise-webp-quality 0 1173 * @tc.desc : 1.create ImageSource 1174 * 2.call packing 1175 * 3.return array 1176 * @tc.size : MEDIUM 1177 * @tc.type : Functional 1178 * @tc.level : Level 1 1179 */ 1180 it("SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_0200", 0, async function (done) { 1181 let packOpts = { format: ["image/jpeg"], quality: 0 }; 1182 packingPromise(done, "SUB_GRAPHIC_IMAGE_WEBP_PACKING_PROMISE_0200", packOpts); 1183 }); 1184 }); 1185} 1186