codingjoe / django-pictures

Responsive cross-browser image library using modern codes like AVIF & WebP
BSD 2-Clause "Simplified" License
248 stars 20 forks source link

Warning Fields.E101 Hint #185

Closed alexwayne closed 3 weeks ago

alexwayne commented 1 month ago

Hi,

While running makemigrations using Django version 5.1.1 and django-pictures 1.3.3, I got a warning:

WARNINGS: items.Item.picture: (fields.E101) width_field and height_field attributes are missing HINT: Please add two positive integer fields to 'items.Item' and add their field names as the 'width_field' and 'height_field' attribute for your picture field. Otherwise Django will not be able to cache the image aspect size causing disk IO and potential response time increases.

codingjoe commented 3 weeks ago

Hi @alexwayne,

Thank you for reaching out. The warning is part of this library to better inform people about potential performance drawbacks. If you have any specific questions, please don't hesitate to as the in the Q&A section in our discussion board here on GitHub.

Best Joe

alexwayne commented 3 weeks ago

Sounds great! Thanks. I did add those fields and the warning went away. Useful.