def METHOD_NAME(self, name, size=None, *extra):
    func = getattr(imageop, name)
    for height in VALUES:
        for width in VALUES:
            strlen = abs(width * height)
            if size:
                strlen *= size
            if strlen < MAX_LEN:
                data = "A" * strlen
            else:
                data = AAAAA
            if size:
                arguments = (data, size, width, height) + extra
            else:
                arguments = (data, width, height) + extra
            try:
                func(*arguments)
            except (ValueError, imageop.error):
                pass