I was really hoping this would implement some complex algorithm or at least be an interesting implementation, however, it seems to just divide the image height/width by the aspect ratio:
https://github.com/xkeshi/image-compressor/blob/master/src/i...