-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: feature requestIssue suggesting a new featureIssue suggesting a new featureseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solveIf the issue only affects a very niche base of users and an easily implemented workaround can solve
Description
Describe the bug (feature)
In Strapi of version beta.20 there is a new possibility - creation of thumbnails of images. This is very useful and convenient feature. Thank you. In previous versions I had to do it by my own with help of sharp package: I could resize and rotate an image according to EXIF orientation tag.
New upload plugin does not automatically rotate images, so photos from iphone with "portrait" orientation (orientation tag 6) appears with wrong rotation.
So I want to ask:
- Is there any way to "hook" upload process to rotate an image (or do some other manipulations)?
- Is there any way to choose necessary formats? For example, I need thumbnail and medium size, but I don't need large size, sometimes I don't even need original file.
Steps to reproduce the behavior
- Upload any image with EXIF orientation tag equaled 6 (photo from iphone with "portrait" orientation).
- Go to "Media Library".
- Ensure the image has improper rotation.
Expected behavior
I would like images to be properly rotated.
Screenshots
In Finder:

In Media Library (the building "fell down"):

Code snippets
My implementation of auto rotation:
// sharp automatically rotates image according to orientation tag
const thumbnailBuffer = await sharp(file.path)
.resize(300)
.rotate()
.toBuffer();System
- Node.js version: 13.13.0
- NPM version: 6.14.4
- Strapi version: 3.0.0-beta.20.1
- Database: PostgreSQL 12.2
- Operating system: MacOS Catalina 10.15.4
Metadata
Metadata
Assignees
Labels
issue: feature requestIssue suggesting a new featureIssue suggesting a new featureseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solveIf the issue only affects a very niche base of users and an easily implemented workaround can solve