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 Plugin #148

Merged
merged 3 commits into from Mar 6, 2015
Merged

Watermark Plugin #148

merged 3 commits into from Mar 6, 2015

Conversation

@abdul
Copy link
Contributor

@abdul abdul commented Mar 2, 2015

This plugin allows adding watermark to images.

Settings:
- ``watermark``: path to the watermark image.
- ``watermark_position``: the watermark position (scale or tile)

This comment has been minimized.

@saimn

saimn Mar 3, 2015
Owner

From the code it seems that it is also possible to specify the position with a tuple which is given to http://pillow.readthedocs.org/reference/Image.html#PIL.Image.Image.paste
Could you also document this behavior ?

if settings['watermark_position']:
position = settings['watermark_position']
if settings['watermark_opacity']:
opacity = settings["watermark_opacity"]

This comment has been minimized.

@saimn

saimn Mar 3, 2015
Owner

You could use settings("watermark_opacity", 1) to simplify the code, the same for watermark_position.


def add_watermark(img, settings=None):
logger.debug('Adding watermark to %r', img)
mark = Image.open(settings['watermark'])

This comment has been minimized.

@saimn

saimn Mar 3, 2015
Owner

The path here is relative to the cwd. To allow running sigal from another directory, and be consistent with other path settings, could you add the watermark setting here https://github.com/saimn/sigal/blob/master/sigal/settings.py#L126 to make it relative to the settings file ?

@saimn
Copy link
Owner

@saimn saimn commented Mar 3, 2015

Looks good (with some minor comments), thanks for the contribution !

@abdul
Copy link
Contributor Author

@abdul abdul commented Mar 3, 2015

I would make these changes, and update the PR. Thanks for the feedback.

On Wed, Mar 4, 2015 at 4:11 AM, Simon Conseil notifications@github.com
wrote:

Looks good (with some minor comments), thanks for the contribution !


Reply to this email directly or view it on GitHub
#148 (comment).

abdul added 3 commits Mar 2, 2015
- Make watermark path relative to settings file
- Document possible options for watermark_postion
- Simplify code to use settings.get(<setting>, <default>)
@abdul abdul force-pushed the abdul:watermark_plugin branch from eeb2e8a to 8986f58 Mar 6, 2015
@abdul
Copy link
Contributor Author

@abdul abdul commented Mar 6, 2015

@saimn I have update the code, please review. Thank you.

saimn added a commit that referenced this pull request Mar 6, 2015
Watermark Plugin
@saimn saimn merged commit d4dedea into saimn:master Mar 6, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@saimn
Copy link
Owner

@saimn saimn commented Mar 6, 2015

Thanks !

@abdul
Copy link
Contributor Author

@abdul abdul commented Mar 6, 2015

Thank you.

On Friday, March 6, 2015, Simon Conseil notifications@github.com wrote:

Thanks !


Reply to this email directly or view it on GitHub
#148 (comment).

Sent from Gmail Mobile

@abdul abdul deleted the abdul:watermark_plugin branch Mar 10, 2015
@saimn saimn modified the milestone: 0.10 Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.