melinath / django-daguerre

On-the-fly image manipulation for Django.
http://django-daguerre.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
85 stars 15 forks source link

Customize daguerre's directory path #103

Closed fitodic closed 7 years ago

fitodic commented 7 years ago

Construct the directory path where the adjusted images will be saved to using the MD5 hash algorithm.

Can be customized using the DAGUERRE_PATH setting set in the project's settings. If left unspecified, the default value will be used, i.e 'dg'. The maximum length of the specified string is 13 characters.

Example:

Known issue: If the extracted hash string is 'ad', ad blockers will block the image. All occurrences of 'ad' will be replaced with 'ag' since the MD5 hash produces letters from 'a' to 'f'.

Other:

Connected to issue #102

A special thanks to @mislavcimpersak

fitodic commented 7 years ago

All your suggestions have been taken into consideration and implemented. I've added a section to the daguerre's documentation regarding the newly available custom setting.

fitodic commented 7 years ago

Thanks for the feedback! The following changes have been commited:

  1. DEFAULT_ADJUSTED_IMAGE_PATH: The name of the local variable was changed according to the convention and to better match the model's name.
  2. Documentation: Along with removing the trailing slash from the default value, the custom settings section was revised and simplified by adding a couple of examples.
fitodic commented 7 years ago

They typo was fixed and pushed.

fitodic commented 7 years ago

The daguerre clean management command and the tests covering it have been updated to reflect the newly introduced changes to the image path.

melinath commented 7 years ago

Merged, thanks for your hard work on this!

fitodic commented 7 years ago

My pleasure, thanks for your help!