zimeon / iiif

IIIF Image API reference implementation and Python library
GNU General Public License v3.0
55 stars 15 forks source link

Bug in max*? #25

Closed jpstroop closed 8 years ago

jpstroop commented 8 years ago

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.

jpstroop commented 8 years ago

Oh, nevermind, I get it.