Fix input image truncation
Due to a bug in the algorithm that computes the bounding box in the input image that actually needs to be resampled, sometimes resampled images may contain only a part of the input image, in particular when a corner of the input image is outside of the output frame.
See #89 for more details.