def get_png_dim(filepath: str) -> int:
if not imghdr.what(filepath) == '<STR_LIT>':<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>head = open(filepath, '<STR_LIT:rb>').read(<NUM_LIT>)<EOL>return struct.unpack('<STR_LIT>', head[<NUM_LIT:16>:<NUM_LIT>])<EOL>
get_png_dim(filepath:str) -> (int)
Finds the dimension of a PNG.
:param filepath: file path of the PNG.
:returns: (width, height).