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

Watermark addon added #29

Merged
merged 2 commits into from
Feb 2, 2016
Merged

Watermark addon added #29

merged 2 commits into from
Feb 2, 2016

Conversation

bikmazer
Copy link
Contributor

Simple Module Config file (MyModuleName/config/thumbnails.php)

<?php
[
return [
    'coverImage' => [
        'fit' => [
            'width' => '200',
            'height' => null,
            'callback' => function ($constraint) {
                $constraint->upsize();
            }
        ],
        'watermark' => [
            'source' => 'public/assets/watermark.png', // if changing required
            'position' => 'top-right' // if changing required
        ]
    ]
];

{
$options = array_merge($this->defaults, $options);

return $image->insert($options['source'],$options['position'], $options['x'], $options['y']);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No space found after comma in function call

@bikmazer
Copy link
Contributor Author

Don't forget refresh thumbnails

php artisan asgard:media:refresh

https://asgardcms.com/docs/media-module/refreshing-thumbnails.

nWidart added a commit that referenced this pull request Feb 2, 2016
@nWidart nWidart merged commit db257fb into AsgardCms:master Feb 2, 2016
@nWidart
Copy link
Member

nWidart commented Feb 2, 2016

Thank you 👍

@oimken
Copy link
Contributor

oimken commented Feb 2, 2016

I think watermark should be a backend controller for Media module,
so we can select which image/watermark to use,
and decide where to put the watermark depends on image content.
Because not every image need watermark, such as background image, icon, etc.

If need a batch, checkboxes will be much better than php artisan asgard:media:refresh, it is overkill.

@nWidart
Copy link
Member

nWidart commented Feb 2, 2016

This is a filter from the intervention library, so in my opinion it makes sense to have it like the other filters.

The same could be true with thumbnails, not all images will need all types of thumbnails, still that's how it works currently.

However the watermark could still be added in an another matter via gui.

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.

4 participants