resizeFile

fun resizeFile(fileToResize: File, dimension: FileResizerHelper.Dimension): File

Resize an image file to a given dimension. The possible dimensions are small (256px), medium (512px) and large (1024px). The method will scale the largest between height and width to the given dimension without change the relation between them. In case both height and width are smaller than the given dimension the method will return the given file without modifications.

The EXIF orientation is baked into the pixels of the resized image, since re-encoding it drops the metadata.

Return

The resized File.

Parameters

fileToResize

Image file to resize.

dimension

The dimension to resize.