8000 Bugfix: Skip default photo cropping if unchecked by jessedobbelaere · Pull Request #3151 · forkcms/forkcms · GitHub
[go: up one dir, main page]

Skip to content

Bugfix: Skip default photo cropping if unchecked#3151

Merged
carakas merged 1 commit intoforkcms:masterfrom
jessedobbelaere:media-skip-cropping-if-unchecked
Jul 31, 2020
Merged

Bugfix: Skip default photo cropping if unchecked#3151
carakas merged 1 commit intoforkcms:masterfrom
jessedobbelaere:media-skip-cropping-if-unchecked

Conversation

@jessedobbelaere
Copy link
Member

Type

  • Non critical bugfix

Resolves the following issues

Fixes #2877

Pull request description

When we upload an image, it gets passed to the cropper by default, even if the cropper checkbox is unchecked before uploading. As Stijn mentions in #2877 when you upload his image of 392KB you end up with an image of 455KB.
By adding an early return in the scaling config, we bypass the cropper logic and end up with an uploaded image of 392KB still ✅

However, the Fine Uploader gets initialized when the page loads. Therefore, when we toggle the checkbox we have to destroy the uploader dropzone and re-init fineuploader with no scaling config (if cropper is disabled) or with custom scaling config (if cropper is enabled).

This fix will also allow for a fix for #3150 as the EXIF data is only removed when using the cropper 🙌 This means LiipImagineBundle can rotate images and strip the exif data properly.

Screenshot 2020-07-19 at 14 21 17

@jessedobbelaere jessedobbelaere requested a review from a team as a code owner July 19, 2020 13:28
@carakas carakas added this to the 5.8.4 milestone Jul 19, 2020
@carakas
Copy link
Member
carakas commented Jul 19, 2020

Nice :D Thanks Jesse

@carakas carakas merged commit d6654fc into forkcms:master Jul 31, 2020
@carakas carakas modified the milestones: 5.9.1, 5.9.0 Aug 12, 2020
@jessedobbelaere jessedobbelaere deleted the media-skip-cropping-if-unchecked branch September 21, 2020 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5737

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uncropped MediaLibrary images aren't the size of the original

2 participants

0