def _load_and_check_img(filename, width_expected, height_expected, raster_format_expected, column_format_expected):
im = EscposImage('<STR_LIT>' + filename)<EOL>assert(im.width == width_expected)<EOL>assert(im.height == height_expected)<EOL>assert(im.to_raster_format() == raster_format_expected)<EOL>i = <NUM_LIT:0> <EOL>for row in im.to_column_format(False):<EOL><INDENT>assert(row == column_format_expected[i])<EOL>i += <NUM_LIT:1><EOL><DEDENT>
Load an image, and test whether raster & column formatted output, sizes, etc match expectations.