You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ImagesPipeline should pass on item to thumb_path function as additional argument.
Motivation
The ImagesPipeline.file_path function allows access to item. So when an user overwrites this function and makes the file name
depended on the item itself, it makes sense to have the thumb path to be depended on the item as well.
This way main image file and thumbnail image file can have the same name and it is easily possible to jump between different sizes of the image.
Example of how a file and thumbnail could be build:
Summary
ImagesPipeline should pass on item to thumb_path function as additional argument.
Motivation
The ImagesPipeline.file_path function allows access to item. So when an user overwrites this function and makes the file name
depended on the item itself, it makes sense to have the thumb path to be depended on the item as well.
This way main image file and thumbnail image file can have the same name and it is easily possible to jump between different sizes of the image.
Example of how a file and thumbnail could be build:
So I suggest to change the signature of ImagesPipeline.thumb_path to the following:
which makes the functions thumb_path and file_path more consistent.
Describe alternatives you've considered
As a workaround when I overwrite
file_path
I setrequest._item = item
which I can then access inthumb_path
function.Additional context
In case this is of interest I am happy to work on a pull request.
The text was updated successfully, but these errors were encountered: