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

Add setting auto_fix_orientation to enable auto image rotation #1766

Merged
merged 3 commits into from
Feb 27, 2023
Merged

Add setting auto_fix_orientation to enable auto image rotation #1766

merged 3 commits into from
Feb 27, 2023

Conversation

wladif
Copy link
Contributor

@wladif wladif commented Feb 22, 2023

Currently, imported images are automatically rotated even when the editor_enabled is disabled, the automatic rotation takes place as part of the image normalization process.
This feels a bit unintuitive and this PR fixes it by taking into account this setting when normalizing the image.

Currently, imported images are automatically rotated even when the editor_enabled is disabled, the automatic rotation takes place as part of the image normalization process.
 This feels a bit unintuitive and this PR fixes it by taking into account this setting when normalizing the image.
@ildyria
Copy link
Member

ildyria commented Feb 22, 2023

No, that setting is to allow the manual rotations buttons in the header.
It is completely unrelated to automatic rotation on upload.

A better approach would be to create an auto_fix_orientation setting (defaulted to 1) in the Image Processing category and use it instead.

You can use php artisan make:migration add_auto_fix_orientation_setting to create a stub for the database migration.

@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Merging #1766 (cb83a38) into master (c138459) will decrease coverage by 0.48%.
The diff coverage is 100.00%.

Additional details and impacted files

@wladif
Copy link
Contributor Author

wladif commented Feb 22, 2023

I've avoided adding another setting because to me it made more sense that if I, as a user, can't edit the image the system should not be allowed to do it either, this will not be the case with an extra setting (not without extra logic anyway).
I'll update the PR to add the extra setting. Thanks!

@wladif wladif marked this pull request as draft February 24, 2023 07:57
@wladif wladif changed the title Honor the editor_enabled setting when normalizing images Add setting to control the automatic image rotation Feb 24, 2023
@ildyria ildyria marked this pull request as ready for review February 26, 2023 21:07
@ildyria
Copy link
Member

ildyria commented Feb 26, 2023

@wladif I fixed the formatting issue (make formatting) could you confirm this is ready for review ? :)

Copy link
Member

@ildyria ildyria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@wladif
Copy link
Contributor Author

wladif commented Feb 27, 2023

@ildyria Thanks for fixing the formatting. Yes, it's ready for review.

@ildyria ildyria changed the title Add setting to control the automatic image rotation Add setting auto_fix_orientation to enable auto image rotation Feb 27, 2023
@ildyria ildyria merged commit 4bd8897 into LycheeOrg:master Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants