MCPcopy
hub / github.com/processing/p5.js / imageToDataURL

Function imageToDataURL

visual-report.js:17–26  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

15
16 // Function to read image file and convert to data URL
17 function imageToDataURL(filePath) {
18 try {
19 const data = fs.readFileSync(filePath);
20 const base64 = data.toString('base64');
21 return `data:image/png;base64,${base64}`;
22 } catch (error) {
23 console.error(`Failed to read image: ${filePath}`, error);
24 return null;
25 }
26 }
27
28 // Create a lookup map for actual screenshots
29 function createActualScreenshotMap() {

Callers 1

findTestCasesFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected