I am using gallery magick library to resize the original image.
It is working fine except some images in which I would only like to set the width to 900px and calculate the height proportionally.
If I call the method ScalrProcessorUtils.resizeImage(ContentFileObjectUtils.toFile(sourceFile), ContentFileObjectUtils.toFile(targetFile), dimension);
By passing as dimension 900x0 , I get the final image resized to 1x1
This is probably because in Scalr.java there is
targetHeight = Math.round((float) targetWidth * ratio);
which sets also the targetHeight to 0
Is there a more proper way to set the dimension instead of 900x0 or is there something to be fixed?