MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / checkPNG

Method checkPNG

tools/png2bmp.js:176–184  ·  view source on GitHub ↗
(png)

Source from the content-addressed store, hash-verified

174 this.outputPath = this.splitPath(this.inputPaths[0]).directory;
175 }
176 checkPNG(png) {
177 if (png.depth != 8)
178 return false;
179 if ((png.channels == 1) && (png.palette)) {
180 png.palette = new Uint8Array(png.palette);
181 return true;
182 }
183 return (png.channels == 2) || (png.channels == 3) || (png.channels == 4);
184 }
185 pad(width) {
186 const colorDepth = (this.color) ? Bitmap.depth(this.colorFormat) : 32;
187 const alphaDepth = (this.alpha) ? Bitmap.depth(this.alphaFormat) : 32;

Callers 1

runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected