This code comes from https://github.com/image-size/image-size/pull/370, and is slightly modified (all import statements have file extensions added to them). 

The `fromFile` functionality has also been removed, as it was not being used. 
