Skip to content

Commit

Permalink
Merge pull request #433 from saimn/webp
Browse files Browse the repository at this point in the history
Add webp support
  • Loading branch information
saimn authored Jun 27, 2021
2 parents fee8a3c + 883b523 commit 95d1023
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion sigal/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
'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,
Expand Down
Binary file added tests/sample/pictures/webp/_MG_7805_lossy80.webp
Binary file not shown.
Binary file not shown.
12 changes: 9 additions & 3 deletions tests/test_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@
'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']
},
}


Expand Down

0 comments on commit 95d1023

Please sign in to comment.