diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py index cd1638b..8a556c4 100644 --- a/core/views/editor_helpers.py +++ b/core/views/editor_helpers.py @@ -74,9 +74,9 @@ def new_image_form(request, path): tscale = max(width / THUMBNAIL_WIDTH, height / THUMBNAIL_HEIGHT) thumbnail = i.resize((int(width / tscale), int(height / tscale)), Image.ANTIALIAS) ib = io.BytesIO() - i.save(ib, format="png") + i.save(ib, format="jpeg", quality = 75) tb = io.BytesIO() - thumbnail.save(tb, format="png") + thumbnail.save(tb, format="jpeg", quality = 70) image_rel_path, thumb_rel_path, desc_rel_path = form.get_rel_paths() image_page_template = loader.get_template("image_page_template.html") image_page = image_page_template.render( @@ -146,8 +146,8 @@ class NewWebImageForm(forms.Form): def get_rel_paths(self): f = self.cleaned_data["file_"] return [ - self.directory / "i" / (f.name.rsplit(".", 1)[0] + ".png"), - self.directory / "t" / (f.name.rsplit(".", 1)[0] + ".png"), + self.directory / "i" / (f.name.rsplit(".", 1)[0] + ".jpg"), + self.directory / "t" / (f.name.rsplit(".", 1)[0] + ".jpg"), self.directory / "l" / (f.name.rsplit(".", 1)[0] + ".html"), ]