Skip to content
Snippets Groups Projects
Unverified Commit 310b41c4 authored by roadscape's avatar roadscape Committed by GitHub
Browse files

Merge pull request #118 from steemit/quochuy-autorotate_images

Community - Automatically rotate images
parents e65cc8d3 c52f252b
No related branches found
No related tags found
No related merge requests found
...@@ -319,13 +319,13 @@ export async function proxyHandler(ctx: KoaContext) { ...@@ -319,13 +319,13 @@ export async function proxyHandler(ctx: KoaContext) {
switch (options.mode) { switch (options.mode) {
case ScalingMode.Cover: case ScalingMode.Cover:
image.resize(width, height).crop() image.rotate().resize(width, height, {fit: 'cover'})
break break
case ScalingMode.Fit: case ScalingMode.Fit:
if (!width) { width = maxWidth } if (!width) { width = maxWidth }
if (!height) { height = maxHeight } if (!height) { height = maxHeight }
image.resize(width, height).max().withoutEnlargement() image.rotate().resize(width, height, { fit: 'inside', withoutEnlargement: true })
break break
} }
......
...@@ -286,10 +286,10 @@ ...@@ -286,10 +286,10 @@
"@types/express-serve-static-core" "*" "@types/express-serve-static-core" "*"
"@types/mime" "*" "@types/mime" "*"
"@types/sharp@^0.17.6": "@types/sharp@^0.21.0":
version "0.17.10" version "0.21.3"
resolved "https://registry.yarnpkg.com/@types/sharp/-/sharp-0.17.10.tgz#4f546861c53fae2b1bffcdd1ae7e691cc68afa52" resolved "https://registry.yarnpkg.com/@types/sharp/-/sharp-0.21.3.tgz#82f89f99536557e397c0c46f5ea50dcc1529fe35"
integrity sha512-nISitptrYm6hUpiC+vN21cbT8Of54TubXY95N+pcqNCmmXZqd1hRk7fC5HYRRQwWJiKV/NLHx8f4CxPIsIQXqg== integrity sha512-wgCw1OO/iQ3w13WVRhx1fHoo5NDHq+444wqTnKcAWA9YMj1a9stoLlfLjW1mJJkFG1aRjeKd9KYhiYOJ3H7qEg==
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
......
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