SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.39k stars 319 forks source link

THUMBNAIL_NAMER not working as expected #492

Open bmoe872 opened 6 years ago

bmoe872 commented 6 years ago

Hello,

Pertinent Req's installed: easy-thumbnails==2.5.0 django==1.11.7 django-filer==1.2.7 Pillow==4.2.1

I have set in my settings.py file:

# Thumbnail Settings
THUMBNAIL_HIGH_RESOLUTION = False  # Retina images
THUMBNAIL_DEFAULT_OPTIONS = {'replace_alpha': '#fff', 'quality': 85, 'upscale': True, 'autocrop': True}
THUMBNAIL_NAMER = 'easy_thumbnails.namers.alias'
THUMBNAIL_OPTIMIZE_COMMAND = {
    'png': '/usr/bin/optipng {filename}',
    'gif': '/usr/bin/optipng {filename}',
    'jpeg': '/usr/bin/jpegoptim {filename}'
}

THUMBNAIL_PROCESSORS = (
    'easy_thumbnails.processors.colorspace',
    'easy_thumbnails.processors.autocrop',
    'filer.thumbnail_processors.scale_and_crop_with_subject_location',
    'common.thumbnail_processors.canvas',
    'easy_thumbnails.processors.filters',
)

I would expect that the filenames of my thumbnail created files would come out as the alias name.

So for instance, if I have a thumbnail like so: 'home_image': {'size': (1700, 650), 'size_canvas': True, 'crop': 'scale', 'autocrop': False},

Then I would expect to see home_image somewhere in the thumbnail name, but instead I am seeing: <path_to_media_filer>/<original_filename>__1700x650_q85_crop-scale_size_canvas_subsampling-2.jpg

Any Help would be greatly appreciated, and this might be an issue with filer and easy-thumbnails together. If that is the case, I will rename the issue accordingly.

benzkji commented 6 years ago

I face the same problem (with filer). None of the namers seem to work, it's always the default namer that is used. Will check if a self made custom namer migth work...

benzkji commented 6 years ago

as I wanted to do in #474 ...

benzkji commented 6 years ago

it has tests, so this could be a filer compat issue...

https://github.com/SmileyChris/easy-thumbnails/blob/master/easy_thumbnails/tests/test_namers.py

bmoe872 commented 6 years ago

When I ran into this, that was my gut feeling too, but I didn't have anything to prove it specifically.

benzkji commented 6 years ago

Yet no clue how to override the override...?

benzkji commented 6 years ago

It definitly is a filer issue: https://github.com/divio/django-filer/issues/1093