def get_size(self, image_size):
    (w, h) = image_size
    size = self.min_size[0]
    if (w < h):
        return (self.max_size, size)
    else:
        return (size, self.max_size)
def get_size(self, image_size):
    (w, h) = image_size
    size = self.min_size[0]
    if (w < h):
        return (self.max_size, size)
    else:
        return (size, self.max_size)