With the current implementation of Thumbnail.cs in the master branch, the division yielding var divisor returns an integer when in fact, a double precision number should be used. When running the code as is, aspect ratios for images are incorrect after processing. E.g. when divisor should be 1.6, a value of 1 will be returned. Same goes for divisor that should be 0.4, a value of 0 will be returned which in the end results in a "Divide by 0" exception to be thrown.
I've solved this in a forked version to explicitly cast one of the factors in the division to a double, like this:
var divisor = image.Width / (double)thumbnailWidth;
With the current implementation of Thumbnail.cs in the master branch, the division yielding var divisor returns an integer when in fact, a double precision number should be used. When running the code as is, aspect ratios for images are incorrect after processing. E.g. when divisor should be 1.6, a value of 1 will be returned. Same goes for divisor that should be 0.4, a value of 0 will be returned which in the end results in a "Divide by 0" exception to be thrown.
I've solved this in a forked version to explicitly cast one of the factors in the division to a double, like this:
var divisor = image.Width / (double)thumbnailWidth;