Skip to content
Snippets Groups Projects
Commit ff34821e authored by Quoc Huy Nguyen Dinh's avatar Quoc Huy Nguyen Dinh
Browse files

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

parent e65cc8d3
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment