Commit ff34821e authored by Quoc Huy Nguyen Dinh's avatar Quoc Huy Nguyen Dinh

Automatically rotate images that were taken in portrait mode froma mobile phone

parent e65cc8d3
......@@ -319,13 +319,13 @@ export async function proxyHandler(ctx: KoaContext) {
switch (options.mode) {
case ScalingMode.Cover:
image.resize(width, height).crop()
image.rotate().resize(width, height).crop()
break
case ScalingMode.Fit:
if (!width) { width = maxWidth }
if (!height) { height = maxHeight }
image.resize(width, height).max().withoutEnlargement()
image.rotate().resize(width, height).max().withoutEnlargement()
break
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment