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

Enable Glide presets to use watermarks #5925

Merged
merged 2 commits into from
Apr 28, 2022
Merged

Conversation

wesort
Copy link
Contributor

@wesort wesort commented Apr 27, 2022

No description provided.

@wesort
Copy link
Contributor Author

wesort commented Apr 27, 2022

I'm afraid I have no idea how to resolve that test failure.

What I do know is:
– with this proposed change it is working for me
– that I had it working with help from @martyf ahead of the v.3.3.8 release with #5725
– I have a filesystems.php disk where I need the originals to be non-public

'disks' => [
    'stills' => [
        'driver' => 'local',
        'root'   => storage_path('app/stills')
    ],
],

– Within /config/statamic/assets.php I have various presets configured, some without watermarks some with watermarks
watermarks/logo-01.png is a dir within /public

'presets' => [
    '360w' => [
        'w' => 360, 
        'q' => 80, 
        'fit' => 'max'
    ],
    'mark_900w' => [
        'w' => 900,
        'q' => 80,
        'fit' => 'max',
        'mark' => 'watermarks/logo-01.png',
        'markw' => '30w',
        'markpos' => 'center',
        'markalpha' => 50
    ],
],

– In my templating I use:

{{ still_image }}
    <img src="{{ glide:still_image preset="mark_1216w" filename="{ filename }" }}">
{{ /still_image }}

@jasonvarga
Copy link
Member

I hadn't thought about the situation where you'd put a watermark in a preset. I think having the public directory as the default makes perfect sense, since dropping a filename in your preset would work the same way as doing mark="something.jpg" in a Glide tag - it looks in the public directory.

I've updated the test for you.

@jasonvarga jasonvarga merged commit e268ded into statamic:3.3 Apr 28, 2022
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.

2 participants