Closed adrenaline681 closed 1 year ago
According to the docs of the library, Link. There are 4 namers available.
Four namers are included in easy_thumbnails: ``easy_thumbnails.namers.default`` Descriptive filename containing the source and options like ``source.jpg.100x100_q80_crop_upscale.jpg``. ``easy_thumbnails.namers.hashed`` Short hashed filename like ``1xedFtqllFo9.jpg``. ``easy_thumbnails.namers.alias`` Filename based on ``THUMBNAIL_ALIASES`` dictionary key like ``source.jpg.medium_large.jpg``. ``easy_thumbnails.namers.source_hashed`` Filename with source hashed, size, then options hashed like ``1xedFtqllFo9_100x100_QHCa6G1l.jpg``.
Since you didn't set it, it will take the default option which will give 1.jpg.100x100_q85.jpg
.
However you have the option to create a custom namer. Link
To write a custom namer, always catch all other keyword arguments arguments (with \\*\\*kwargs). You have access to the following arguments: ``thumbnailer``, ``source_filename``, ``thumbnail_extension`` (does *not* include the ``'.'``), ``thumbnail_options``, ``prepared_options``.
Also here Link
When using the ThumbnailerImageField, the original file is saved correctly but the thumbnails are being saved with a duplicate file extension:
Example:
I would like the thumbnails to be named like this:
1.100x100_q85.jpg
My model looks like this:
Since I'm using Django Rest Framework I created a serializer following this post: Django easy-thumbnails serialize with Django Rest Framework
Why is the extension not being removed from the filename before adding the ".100x100_q85.jpg"