Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image dimensions during exif rotation have been corrected #791

Merged
merged 1 commit into from
Oct 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/core/src/utils/image-bitmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function getMIMEFromBuffer(buffer, path) {
/*
* Automagically rotates an image based on its EXIF data (if present)
* @param img a constants object
*/
*/
function exifRotate(img) {
const exif = img._exif;

Expand All @@ -40,22 +40,22 @@ function exifRotate(img) {
img.mirror(true, false);
break;
case 3: // Rotate 180
img.rotate(180, false);
img.rotate(180);
break;
case 4: // Mirror vertical
img.mirror(false, true);
break;
case 5: // Mirror horizontal and rotate 270 CW
img.rotate(-90, false).mirror(true, false);
popinguy marked this conversation as resolved.
Show resolved Hide resolved
img.rotate(-90).mirror(true, false);
break;
case 6: // Rotate 90 CW
img.rotate(-90, false);
img.rotate(-90);
break;
case 7: // Mirror horizontal and rotate 90 CW
img.rotate(90, false).mirror(true, false);
img.rotate(90).mirror(true, false);
break;
case 8: // Rotate 270 CW
img.rotate(-270, false);
img.rotate(-270);
break;
default:
break;
Expand Down