nephila / djangocms-blog

django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks
https://djangocms-blog.readthedocs.io
BSD 3-Clause "New" or "Revised" License
403 stars 190 forks source link

BLOG_IMAGE_FULL_SIZE configuration problem #666

Open YOBA1112 opened 3 years ago

YOBA1112 commented 3 years ago

Description

Pictures not loading, raising an exception

'640' is not a valid size.

Steps to reproduce

1.Install djangocms-blog via pip 2.Complete the installation 3.In settings.py set THUMBNAIL_DEBUG = True 4.Create an article containing a main image, like so изображение 5.Open the page that you've just created

Versions

aldryn-apphooks-config 0.6.0 easy-thumbnails 2.7.1 django-filer 2.0.2 django-parler 2.2 django-taggit 1.3.0
django-taggit-autosuggest 0.3.8
django-taggit-templatetags 0.2.5
django-meta 2.0.0 django-sortedm2m 3.0.2 djangocms-blog 1.2.3 Django 3.1.6 django-cms 3.8.0 Python 3.8.5

Expected behaviour

1.Link is opening 2.Image is provided

Actual behaviour

So, I've tried to install this app, and at the first glance everything works pretty fine, but when I'm trying to add a picture I get this error.

изображение

This exception is shown because in my settings I set easy-thumbnails debug option to True(link)

Additional information

What I did to fix it is changed BLOG_IMAGE_FULL_SIZE size from 640 to 640x640 in djangocms-blog/settings.py and it worked.

Immeo commented 3 years ago

when there is no BLOG_IMAGE_FULL_SIZE in the settings, the picture also does not appear.

didierCH commented 3 years ago

I just had this same problem: if you don't provide a width AND a height in your settings, the image will not be loaded (the src attribute is empty). It can be fixed with a custom setting like this BLOG_IMAGE_FULL_SIZE = {"size": "640x640", "crop": True, "upscale": False}, but it would be nice if the image would be rendered without specifying the width and height with an HTML attribute. It's hard to deal in responsive designs with it.

bethlakshmi commented 3 years ago

I just stumbled upon this as well - it would lovely to have this in the installation instructions, if nothing else.