import pathlib, struct, zlib, sys
p=pathlib.Path(sys.argv[1]); p.mkdir(parents=True,exist_ok=True)
def chunk(t,d): return struct.pack('!I',len(d))+t+d+struct.pack('!I',zlib.crc32(t+d)&0xffffffff)
rows=b''.join(b'\x00'+bytes([50,180,120])*200 for _ in range(200))
(p/'image.png').write_bytes(b'\x89PNG\r\n\x1a\n'+chunk(b'IHDR',struct.pack('!2I5B',200,200,8,2,0,0,0))+chunk(b'IDAT',zlib.compress(rows))+chunk(b'IEND',b''))
(p/'media.md').write_text('''# Markdown image dimensions

Source image: 200 × 200 pixels. Requested size: 14 pixels.

### PR Review in progress <img src="./image.png" width="14px" height="14px" />
Both dimensions: `width="14px" height="14px"`

### Width only <img src="./image.png" width="14px" />
`width="14px"`

### Height only <img src="./image.png" height="14px" />
`height="14px"`

### Numeric control <img src="./image.png" width="14" height="14" />
`width="14" height="14"`
''')
