This method change looks quite specialised now. I'm assuming the change was to take into account the skewed (i.e. non-rectilinear) transform and will only work if the skew is in a specific direction? Would it be possible to take the maximum and minimum of all 4 corners to generalise this?