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

Retina #938

Closed
kironet opened this issue May 20, 2017 · 2 comments
Closed

Retina #938

kironet opened this issue May 20, 2017 · 2 comments

Comments

@kironet
Copy link

kironet commented May 20, 2017

Q A
Bug Report? no
Feature Request? no
BC Break Report? no
RFC? yes
Imagine Bundle Version last one

Hey,

is it possible to somehow intergrate retina support?
If retina show double size.

Or how to generate 2 images.
first one car.jpg
second one [email protected]

Thanks

@robfrawley
Copy link
Collaborator

robfrawley commented May 20, 2017

At the moment, you can just define two separate filter sets for normal and retina displays. You can configure any number of filter definitions to solve any resolution requirements, including those you may encounter with retina displays.

liip_imagine:
    filter_sets:

        # normal thumbnails
        thumbnail_normal:
            jpeg_quality:          85
            png_compression_level: 8
            filters:
                auto_rotate: ~
                strip: ~
                thumbnail:
                    size:          [256, 256]
                    mode:          outbound
                    allow_upscale: true

        # retina thumbnails
        thumbnail_retina:
            jpeg_quality:          85
            png_compression_level: 8
            filters:
                auto_rotate: ~
                strip: ~
                thumbnail:
                    size:          [512, 512]
                    mode:          outbound
                    allow_upscale: true
{# you need to define your own extension to determine if the display is retina #}
{# the `is_retina_display()` function below is only for the purpose of this example #}
{% if is_retina_display() %}
    <img src="{{ imagine_filter('thumbnail_retina', imagePath) }}" />
{% else %}
    <img src="{{ imagine_filter('thumbnail_normal', imagePath) }}" />
{% endif %}

@kironet
Copy link
Author

kironet commented May 20, 2017

@robfrawley thank. Sorry, but how to generate two images with different name
car.jpg nad [email protected]?

Right now i'm doing it like it is shown in documentation:

<img class="replace-2x" src="{{ asset('/path/to/car.jpg') | imagine_filter('thumb') }}" />

Thanks

//oh you're edited your answer, nice thanks :)

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

No branches or pull requests

2 participants