1- import { importSkia , surface } from "../setup" ;
1+ import { surface } from "../setup" ;
22
33describe ( "Data Encoding" , ( ) => {
44 it ( "encodeToBytes() from CPU image" , async ( ) => {
@@ -12,13 +12,13 @@ describe("Data Encoding", () => {
1212 }
1313 return Array . from ( img . encodeToBytes ( ) ) ;
1414 } ) ;
15- const { Skia } = importSkia ( ) ;
16- const data = Skia . Data . fromBase64 (
17- "R0lGODlhAQABAIAAAGGqHwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="
18- ) ;
19- const img = Skia . Image . MakeImageFromEncoded ( data ) ! ;
20- expect ( img ) . toBeTruthy ( ) ;
21- expect ( result ) . toEqual ( Array . from ( img . encodeToBytes ( ) ) ) ;
15+ expect ( result ) . toEqual ( [
16+ 137 , 80 , 78 , 71 , 13 , 10 , 26 , 10 , 0 , 0 , 0 , 13 , 73 , 72 , 68 , 82 , 0 , 0 , 0 , 1 ,
17+ 0 , 0 , 0 , 1 , 8 , 2 , 0 , 0 , 0 , 144 , 119 , 83 , 222 , 0 , 0 , 0 , 3 , 115 , 66 , 73 , 84 ,
18+ 8 , 8 , 8 , 219 , 225 , 79 , 224 , 0 , 0 , 0 , 1 , 115 , 82 , 71 , 66 , 0 , 174 , 206 , 28 ,
19+ 233 , 0 , 0 , 0 , 12 , 73 , 68 , 65 , 84 , 8 , 153 , 99 , 72 , 92 , 37 , 15 , 0 , 2 , 154 ,
20+ 1 , 43 , 48 , 0 , 62 , 135 , 0 , 0 , 0 , 0 , 73 , 69 , 78 , 68 , 174 , 66 , 96 , 130 ,
21+ ] ) ;
2222 } ) ;
2323 it ( "encodeToBase64() from CPU image" , async ( ) => {
2424 const result = await surface . eval ( ( Skia ) => {
@@ -31,14 +31,9 @@ describe("Data Encoding", () => {
3131 }
3232 return img . encodeToBase64 ( ) ;
3333 } ) ;
34- const { Skia } = importSkia ( ) ;
35-
36- const data = Skia . Data . fromBase64 (
37- "R0lGODlhAQABAIAAAGGqHwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="
34+ expect ( result ) . toEqual (
35+ "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAA3NCSVQICAjb4U/gAAAAAXNSR0IArs4c6QAAAAxJREFUCJljSFwlDwACmgErMAA+hwAAAABJRU5ErkJggg=="
3836 ) ;
39- const img = Skia . Image . MakeImageFromEncoded ( data ) ! ;
40- expect ( img ) . toBeTruthy ( ) ;
41- expect ( result ) . toEqual ( img . encodeToBase64 ( ) ) ;
4237 } ) ;
4338 it ( "encodeToBytes() from GPU image" , async ( ) => {
4439 const result = await surface . eval ( ( Skia ) => {
0 commit comments