Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Pillow rather than Imagemagick for thumbnail generation #1104

Merged
merged 18 commits into from
Apr 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
01057f4
feat(imagetools): use Pillow (instead of imagemagick) for thumbnailing
dairiki Feb 25, 2023
ede0c49
feat(imagetools): clean up remnants of imagemagick config
dairiki Feb 25, 2023
5822b33
test(imagetools): enable mypy checks
dairiki Feb 26, 2023
f009e05
style: delete "yay shitty library" null strptime
dairiki Apr 18, 2023
ef8bb12
refactor(imagetools): convert Thumbnail to a dataclass
dairiki Feb 25, 2023
19f3710
test(imagetools): add color-space handling test page to test demo pro…
dairiki Apr 14, 2023
e22a3bd
fix: get_image_info(): return format=None for short file
dairiki Apr 14, 2023
604d8c7
test(imagetools): unit tests for new code in imagetools
dairiki Apr 13, 2023
bc4f86d
refactor(imagetools): omit sRGB color profile from thumbnails
dairiki Apr 15, 2023
fb52152
refactor(imagetools): make Pillow a required dependency
dairiki Apr 15, 2023
1a74800
refactor(tests): remove test_images.py
dairiki Apr 17, 2023
dd9cc55
fix(imagetools): _combine_make - return model (not make)
dairiki Apr 16, 2023
408d8a2
test: Test with older versions of Pillow - 6.0.x and 7.0.x
dairiki Apr 18, 2023
46c8a03
fix: fixes for Pillow versions 6.x and 7.x
dairiki Apr 18, 2023
ec357bc
refactor(imagetools): encapsulate thumbnail parameters in dataclass
dairiki Apr 18, 2023
432ec7e
test(imagetools): test that Pillow does not implicitly save metadata
dairiki Apr 19, 2023
04ff742
feat!: convert warning to error when thumbnail dim missing
dairiki Apr 19, 2023
ab7638c
Revert "ci: pin coverage<7.0.2 on macOS (#1132)"
dairiki Apr 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 1 addition & 16 deletions lektor/environment/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@


DEFAULT_CONFIG = {
"IMAGEMAGICK_EXECUTABLE": None,
"EPHEMERAL_RECORD_CACHE_SIZE": 500,
"ATTACHMENT_TYPES": {
# Only enable image formats here that we can handle in imagetools.
# Right now this is limited to jpg, png and gif because this is
# the only thing we compile into imagemagick on OS X distributions
# as those are what browsers also support. Thers is no point in
# adding others here as we do not force convert images (yet?) but
# only use it for thumbnailing. However an image should be
# visible even without thumbnailing.
# Right now this is limited to jpg, png and gif.
".jpg": "image",
".jpeg": "image",
".png": "image",
Expand Down Expand Up @@ -61,15 +55,6 @@


def update_config_from_ini(config, inifile):
def set_simple(target, source_path):
rv = config.get(source_path)
if rv is not None:
config[target] = rv

set_simple(
target="IMAGEMAGICK_EXECUTABLE", source_path="env.imagemagick_executable"
)

for section_name in ("ATTACHMENT_TYPES", "PROJECT", "PACKAGES", "THEME_SETTINGS"):
section_config = inifile.section_as_dict(section_name.lower())
config[section_name].update(section_config)
Expand Down