The bounding box cannot be determined using just two corners, but all the four corners should be taken into consideration. If using just two corners, it may happen that part of the tif data is not included. That is because although the tif data is perfectly rectangle, the converted coordinates may not produce rectangle, but instead a skewed area, due to spherical nature of the Earth. I am experimenting with the following code to fix that:
The bounding box cannot be determined using just two corners, but all the four corners should be taken into consideration. If using just two corners, it may happen that part of the tif data is not included. That is because although the tif data is perfectly rectangle, the converted coordinates may not produce rectangle, but instead a skewed area, due to spherical nature of the Earth. I am experimenting with the following code to fix that:
Even this might not solve all the coordinate conversion situations, since the widest and/or tallest points may be somewhere in the midle of the area.