How to use is-png - 1 common examples

To help you get started, we’ve selected a few is-png examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 1j01 / mopaint / src / components / App.js View on Github external
fileReader.onload = () => {
				const arrayBuffer = fileReader.result;
				const uint8Array = new Uint8Array(arrayBuffer);
				if (isPNG(uint8Array)) {
					const metadata = readMetadataSync(uint8Array);
					const formatVersion = metadata["Mopaint Format Version"];
					if (formatVersion) {
						const json = metadata["Program Source"];
					} else {
						// TODO: handle plain image files
								"Loading images is not supported yet (other than Mopaint PNG programs)",
				} else if (uint8Array[0] === "{".charCodeAt(0)) {
					const fileReader = new FileReader();
					fileReader.onload = () => {


Check if a Buffer/Uint8Array is a PNG image

Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis

Popular is-png functions

Popular JavaScript code snippets

Find secure code to use in your application or website