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

The same source appears multiple times for too small images #21

Closed
ausi opened this issue Nov 4, 2016 · 1 comment
Closed

The same source appears multiple times for too small images #21

ausi opened this issue Nov 4, 2016 · 1 comment
Assignees
Labels

Comments

@ausi
Copy link
Member

ausi commented Nov 4, 2016

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

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

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

Duplicate sources should get removed from $srcset in PictureGenerator.php:99.

@ausi ausi added the bug label Nov 4, 2016
@ausi ausi self-assigned this Nov 4, 2016
@ausi
Copy link
Member Author

ausi commented Nov 22, 2016

Fixed in b2681f9.

@ausi ausi closed this as completed Nov 22, 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