Created
September 19, 2017 08:07
-
-
Save codeAshu/8b9c588d02792424f44057a98c8edf2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if language is not english | |
if lang[:2] != 'en': | |
text = text.replace(' ', '%2520') | |
text = u"text:Noto%20Sans_20:" + text | |
res = CloudinaryImage(image_url).image(transformation=[ | |
{"background": "black", "opacity": 80}, | |
{"width": 400, "height": 300, "crop": "scale"}, | |
{"overlay": text, "color": "yellow", "crop": "fit", "width": 300, "height": 250}, | |
]) | |
preview_url = res.split('="')[1][:-3] | |
print preview_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment