Add automatic dimension resizing

Added the feature to resize by longest edge via the server to resolve #10.