Looking here. If I understand the approach, you're using the original width and height to make the scale as accurate as possible, but piping w and h through a set of conditions to arrive at the largest possible size within the protential max_* constraints. So don't you want to do:
scale = float(self.max_width) / float(self.width)
w = int(w * scale + 0.5) # instead of self.width
h = int(h * scale + 0.5) # instead of self.height
I'm looking to steal this :magpie:, so would love to know if I'm missing something.
Looking here. If I understand the approach, you're using the original width and height to make the scale as accurate as possible, but piping
w
andh
through a set of conditions to arrive at the largest possible size within the protentialmax_*
constraints. So don't you want to do:I'm looking to steal this :magpie:, so would love to know if I'm missing something.