Commits

Ales Zabala Alava committed b3754e9

Watermark parameters can be set in settings.py

  • Participants
  • Parent commits 2c8288e

Comments (0)

Files changed (1)

watermarker/templatetags/watermark.py

 QUALITY = getattr(settings, 'WATERMARKING_QUALITY', 85)
 OBSCURE = getattr(settings, 'WATERMARK_OBSCURE_ORIGINAL', True)
 RANDOM_POS_ONCE = getattr(settings, 'WATERMARK_RANDOM_POSITION_ONCE', True)
+PARAMS = getattr(settings, 'WATERMARK_PARAMS', {})
 
 log = logging.getLogger('watermarker')
 
 
     # initialize some variables
     args = args.split(',')
+
+    #If only one argument, look for parameters in settings
+    if len(args) == 1:
+        key = args[0]
+        if args[0] in PARAMS:
+            args = PARAMS[args[0]].split(',')
+
     name = args.pop(0)
     opacity = 0.5
     tile = False