Browse Source

Merge pull request #433 from saimn/webp

Add webp support
pull/435/head
Simon Conseil 5 years ago committed by GitHub
parent
commit
95d1023419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      docs/changelog.rst
  2. 3
      sigal/settings.py
  3. BIN
      tests/sample/pictures/webp/_MG_7805_lossy80.webp
  4. BIN
      tests/sample/pictures/webp/_MG_7808_lossy80.webp
  5. 12
      tests/test_gallery.py

3
docs/changelog.rst

@ -9,6 +9,9 @@ Not released yet.
Sigal now requires Python 3.7+.
- Add option ``max_img_pixels`` to allow processing huge images (sets
``PIL.Image.MAX_IMAGE_PIXELS``) [:issue:`431`].
- Add webp to the list of images formats supported by default [:issue:`433`].
Version 2.2
~~~~~~~~~~~

3
sigal/settings.py

@ -40,7 +40,8 @@ _DEFAULT_CONFIG = {
'google_tag_manager': '',
'ignore_directories': [],
'ignore_files': [],
'img_extensions': ['.jpg', '.jpeg', '.png', '.gif', '.tif', '.tiff'],
'img_extensions': ['.jpg', '.jpeg', '.png', '.gif', '.tif', '.tiff',
'.webp'],
'img_processor': 'ResizeToFit',
'img_size': (640, 480),
'img_format': None,

BIN
tests/sample/pictures/webp/_MG_7805_lossy80.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
tests/sample/pictures/webp/_MG_7808_lossy80.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

12
tests/test_gallery.py

@ -62,11 +62,17 @@ REF = {
'video': {
'title': 'video',
'name': 'video',
'thumbnail': ('video/thumbnails/'
'example%20video.tn.jpg'),
'thumbnail': 'video/thumbnails/example%20video.tn.jpg',
'subdirs': [],
'medias': ['example video.ogv']
}
},
'webp': {
'title': 'webp',
'name': 'webp',
'thumbnail': 'webp/thumbnails/_MG_7805_lossy80.tn.webp',
'subdirs': [],
'medias': ['_MG_7805_lossy80.webp', '_MG_7808_lossy80.webp']
},
}

Loading…
Cancel
Save