@@ -4,7 +4,7 @@ Status](https://travis-ci.org/ui/django-thumbnails.png?branch=master)](https://t
44Design:
55
66- Uses Django Storage API
7- - Uses flexible meta data store. Supports DB and Redis backend .
7+ - Uses flexible meta data store. Uses Redis as metadata store .
88- Supports creating thumbnails in different formats, for example from
99 JPG to WEBP to reduce file size
1010
@@ -56,6 +56,7 @@ THUMBNAILS = {
5656 ' watermarked' : {
5757 ' PROCESSORS' : [
5858 {' PATH' : ' thumbnails.processors.resize' , ' width' : 20 , ' height' : 20 },
59+ # Only supports PNG. File must be of the same size with thumbnail (20 x 20 in this case)
5960 {' PATH' : ' thumbnails.processors.add_watermark' , ' watermark_path' : ' watermark.png' }
6061 ],
6162 }
@@ -81,16 +82,17 @@ THUMBNAILS = {
8182
8283` django-thumbnails ` comes with a few builtin image processors:
8384
85+ ``` python
8486 # To use the following processors, put the arguments of processors in SIZES definition
8587 thumbnails.processors.resize(width, height, method) # # `method` can be `stretch`, `fit` or `fill`
8688 thumbnails.processors.rotate(degrees)
8789 thumbnails.processors.flip(direction)
8890 thumbnails.processors.crop(width, height, center)
8991 thumbnails.processors.add_watermark(watermark_path)
92+ ```
9093
9194Processors are applied sequentially in the same order of definition.
92- ` add_watermark ` only support PNG file with alpha channel, and the dimension must be equal thumbnail's final dimension.
93- In the example ` watermark.png ` should be 20x20.
95+
9496
9597## Storage Backend
9698
@@ -189,6 +191,10 @@ To run tests:
189191
190192# # Changelog
191193
194+ # ## Version 0.6.0 (2021-05-28)
195+
196+ * Added support for watermarking thumbnails. Thanks @ marsha97!
197+
192198# ## Version 0.5.0 (2021-05-1)
193199
194200* You can now pass in `storage` kwarg into `ImageField` so you can specify different storage backends for different fields. Thanks @ marsha97!
0 commit comments