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

Option rework #8

Open
wants to merge 4 commits into
base: 0.x
Choose a base branch
from
Open

Option rework #8

wants to merge 4 commits into from

Conversation

loicsapone
Copy link
Member

This is the rework of the option class. The main idea is to have one class per option, and that each class carries the URL construction and Symfony YAML configuration.

This is a work in progress. I think the simple options (height, width, rotate,...) are fine as I've done them, but there's still the imgproxy “meta options” (e.g. resize). I'd like these “meta options” to be based on the simple options to avoid duplicating code, but I haven't figured out how to do it properly yet.

If anyone has any ideas, I'd love to hear them.

@loicsapone loicsapone linked an issue Jan 13, 2025 that may be closed by this pull request
@loicsapone
Copy link
Member Author

Oh, and I forgot to mention it, but it's a BC break: options will be less verbose, so YAML configuration in Symfony projects may break

For example, in the case of the rotate option, the YAML configuration will change as follows:

# before 
presets:
  plain_thumbnail:
    options:
      rotate: 
        angle: 90

# after
presets:
  plain_thumbnail:
    options:
      rotate: 90

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.

Add options quality
1 participant