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

X descriptor doesn’t get corrected for too small images #18

Closed
ausi opened this issue Aug 25, 2016 · 0 comments
Closed

X descriptor doesn’t get corrected for too small images #18

ausi opened this issue Aug 25, 2016 · 0 comments
Assignees
Labels

Comments

@ausi
Copy link
Member

ausi commented Aug 25, 2016

// 1500x1500 large image
$image = new Image('/path/to/image.jpg', $imagine);

$config = (new PictureConfiguration())
    ->setSize((new PictureConfigurationItem())
        ->setResizeConfig((new ResizeConfiguration())
            ->setWidth(1000)
        )
        ->setDensities('1x, 2x')
    )
;

$pictureGenerator->generate($image, $config, new ResizeOptions())->getImg('/path/to')['srcset'];
// cache/dir/4/image-de332f09.jpg 1x, image.jpg 2x

The descriptor for the image.jpg should be 1.5x in this case, because the image didn’t get upscaled and is only 1500 pixels wide instead of the intended 2000.

@ausi ausi added the bug label Aug 25, 2016
@ausi ausi self-assigned this Aug 25, 2016
@ausi ausi closed this as completed in 78bb6e2 Aug 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant