MCPcopy Index your code
hub / github.com/apache/echarts / inlineImage

Function inlineImage

test/runTest/genReport.js:37–54  ·  view source on GitHub ↗
(imageUrl)

Source from the content-addressed store, hash-verified

35}
36
37async function inlineImage(imageUrl) {
38 if (!imageUrl) {
39 return '';
40 }
41 try {
42 let fullPath = path.join(__dirname, resolveImagePath(imageUrl));
43 // let img = await jimp.read(fullPath);
44 // img.quality(70);
45 // return img.getBase64Async('image/jpeg');
46 let imgBuffer = await readFileAsync(fullPath);
47 return 'data:image/webp;base64,' + imgBuffer.toString('base64');
48 }
49 catch (e) {
50 console.error(e);
51 return '';
52 }
53
54}
55
56function shouldShowMarkAsExpected(test, expectedSource, expectedVersion) {
57 if (expectedSource === 'release' && (expectedVersion !== test.expectedVersion)

Callers 1

genDetailFunction · 0.85

Calls 1

resolveImagePathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…