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

Allow optional profile generation based on asset size #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jnterry
Copy link

@jnterry jnterry commented Jan 8, 2021

Adds ability to skip generation of certain profiles when the size of the input asset is smaller than the size of image that the profile is intended to generate.

This is useful to have a series of standard image sizes, but only generate the ones which are smaller than the input asset:

'profiles' => [
    '4x' => [
        'width'         => 1920,
        'height'        => 0,
        'method'        => 'bestFit',
        'quality'       => 90,
        'skipIfSmaller' => true,
    ],
    '3x' => [
        'width'         => 1440,
        'height'        => 0,
        'method'        => 'bestFit',
        'quality'       => 90,
        'skipIfSmaller' => true,
    ],
    '2x' => [
        'width'         => 960,
        'height'        => 0,
        'method'        => 'bestFit',
        'quality'       => 90,
        'skipIfSmaller' => true,
    ],
    '1x' => [
        'width'         => 480,
        'height'        => 0,
        'method'        => 'bestFit',
        'quality'       => 90,
        'skipIfSmaller' => true,
    ],
],

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.

1 participant