def it_knows_image_width_and_height_after_parsing(self): px_width, px_height = 42, 24 entries = {TIFF_TAG.IMAGE_WIDTH: px_width, TIFF_TAG.IMAGE_LENGTH: px_height} ifd_entries = _IfdEntries(entries) tiff_parser = _TiffParser(ifd_entries) assert tiff_parser.px_width == px_width assert tiff_parser.px_height == px_height
def it_knows_image_width_and_height_after_parsing(self): px_width, px_height = 42, 24 entries = { TIFF_TAG.IMAGE_WIDTH: px_width, TIFF_TAG.IMAGE_LENGTH: px_height, } ifd_entries = _IfdEntries(entries) tiff_parser = _TiffParser(ifd_entries) assert tiff_parser.px_width == px_width assert tiff_parser.px_height == px_height
def dpi_fixture(self, request): resolution_unit, x_resolution, y_resolution = request.param[:3] expected_horz_dpi, expected_vert_dpi = request.param[3:] entries = {TIFF_TAG.RESOLUTION_UNIT: resolution_unit} if x_resolution is not None: entries[TIFF_TAG.X_RESOLUTION] = x_resolution if y_resolution is not None: entries[TIFF_TAG.Y_RESOLUTION] = y_resolution tiff_parser = _TiffParser(entries) return tiff_parser, expected_horz_dpi, expected_vert_dpi