# How standard libraries read PNG files

15 PNG files from loremfile.dev, given to 2 standard-library readers in 8 runtime versions: which read them, which refuse, which differ.

The page: <https://loremfile.dev/compat/png>.

15 PNG files given to 2 readers in 8 runtime versions. Cells of the ordinary files: reads 98, differs 6, refuses 0, crashes 0.

| File | Manifest says | go/image/png | java/javax.imageio | Node.js (no reader) | Python (no reader) | Ruby (no reader) |
|---|---|---|---|---|---|---|
| [`edge/png-with-pdf-extension.pdf`](https://loremfile.dev/edge/png-with-pdf-extension.pdf) (1.4 KB (1,387 bytes)) | nothing compared | **reads** reports height 100, width 100 | **reads** reports frames 1, height 100, width 100 | **no-reader** | **no-reader** | **no-reader** |
| [`edge/zero-byte.png`](https://loremfile.dev/edge/zero-byte.png) (0 B) | nothing compared | **refuses** with errors.errorString: unexpected EOF (expected) | **refuses** with java.io.IOException: no ImageReader accepted the file (expected) | **no-reader** | **no-reader** | **no-reader** |
| [`png/100x100.png`](https://loremfile.dev/png/100x100.png) (1.4 KB (1,387 bytes)) | frames 1, height 100, width 100 | **reads** reports height 100, width 100 | **reads** reports frames 1, height 100, width 100 | **no-reader** | **no-reader** | **no-reader** |
| [`png/10mb.png`](https://loremfile.dev/png/10mb.png) (10 MB (10,015,195 bytes)) | frames 1, height 3255, width 1024 | **reads** reports height 3255, width 1024 | **reads** reports frames 1, height 3255, width 1024 | **no-reader** | **no-reader** | **no-reader** |
| [`png/16bit-256x256.png`](https://loremfile.dev/png/16bit-256x256.png) (2.4 KB (2,357 bytes)) | frames 1, height 256, width 256 | **reads** reports height 256, width 256 | **reads** reports frames 1, height 256, width 256 | **no-reader** | **no-reader** | **no-reader** |
| [`png/1920x1080.png`](https://loremfile.dev/png/1920x1080.png) (11.1 KB (11,110 bytes)) | frames 1, height 1080, width 1920 | **reads** reports height 1080, width 1920 | **reads** reports frames 1, height 1080, width 1920 | **no-reader** | **no-reader** | **no-reader** |
| [`png/1mb.png`](https://loremfile.dev/png/1mb.png) (1 MB (1,000,147 bytes)) | frames 1, height 325, width 1024 | **reads** reports height 325, width 1024 | **reads** reports frames 1, height 325, width 1024 | **no-reader** | **no-reader** | **no-reader** |
| [`png/1x1.png`](https://loremfile.dev/png/1x1.png) (69 B) | frames 1, height 1, width 1 | **reads** reports height 1, width 1 | **reads** reports frames 1, height 1, width 1 | **no-reader** | **no-reader** | **no-reader** |
| [`png/3840x2160.png`](https://loremfile.dev/png/3840x2160.png) (32.4 KB (32,365 bytes)) | frames 1, height 2160, width 3840 | **reads** reports height 2160, width 3840 | **reads** reports frames 1, height 2160, width 3840 | **no-reader** | **no-reader** | **no-reader** |
| [`png/640x480.png`](https://loremfile.dev/png/640x480.png) (4.2 KB (4,208 bytes)) | frames 1, height 480, width 640 | **reads** reports height 480, width 640 | **reads** reports frames 1, height 480, width 640 | **no-reader** | **no-reader** | **no-reader** |
| [`png/animated-apng-10frames-128x128.png`](https://loremfile.dev/png/animated-apng-10frames-128x128.png) (9.1 KB (9,083 bytes)) | frames 10, height 128, width 128 | **reads** reports height 128, width 128 | **differs** reports frames 1 where the manifest has 10 | **no-reader** | **no-reader** | **no-reader** |
| [`png/grayscale-512x512.png`](https://loremfile.dev/png/grayscale-512x512.png) (1.9 KB (1,881 bytes)) | frames 1, height 512, width 512 | **reads** reports height 512, width 512 | **reads** reports frames 1, height 512, width 512 | **no-reader** | **no-reader** | **no-reader** |
| [`png/indexed-8bit-256x256.png`](https://loremfile.dev/png/indexed-8bit-256x256.png) (999 B) | frames 1, height 256, width 256 | **reads** reports height 256, width 256 | **reads** reports frames 1, height 256, width 256 | **no-reader** | **no-reader** | **no-reader** |
| [`png/interlaced-512x512.png`](https://loremfile.dev/png/interlaced-512x512.png) (9.1 KB (9,124 bytes)) | frames 1, height 512, width 512 | **reads** reports height 512, width 512 | **reads** reports frames 1, height 512, width 512 | **no-reader** | **no-reader** | **no-reader** |
| [`png/transparent-256x256.png`](https://loremfile.dev/png/transparent-256x256.png) (3.2 KB (3,231 bytes)) | frames 1, height 256, width 256 | **reads** reports height 256, width 256 | **reads** reports frames 1, height 256, width 256 | **no-reader** | **no-reader** | **no-reader** |

Node.js has no reader for these files. The standard library has no image decoder.

Python has no reader for these files. The standard library has no image decoder. tkinter.PhotoImage is outside the scope rule (docs/07 section 8).

Ruby has no reader for these files. The standard library has no image decoder.

The results as JSON: <https://github.com/kumarprabhashanand/loremfile/blob/main/compat/results/png.json>.
