-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add optional "filter" type to image resize function #2623
base: next
Are you sure you want to change the base?
Conversation
I'm not sure if I have incorrectly configured something, but it seems that running |
|
"catmullrom" => FilterType::CatmullRom, | ||
"gaussian" => FilterType::Gaussian, | ||
_ => return Err(anyhow!("Invalid filter type: {}", filter)), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we convert directly to the filter type from the image crate and skip our own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with a custom type because FilterType from the image crate is not Hash
, so it breaks downstream functionality when the processed image paths are generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just made a PR to impl it, let's see if it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it's released in the most recent version
@aaron404 are you interested in updating that PR? |
@Keats I think I have missed something. You mentioned you made a PR to impl it (I assume impl |
It's image-rs/image@02a4928 |
It looks like we also need FilterType to impl |
IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.
The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.
Sanity check:
Code changes
(Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one:
filter
parameter to theresize_image
function. It defaults tolanczos3
which is what was previously hardcoded. I had to add a mirror of theFilter
type from theimage
crate to implHash
for it. I'm not sure if there's a cleaner way to do this.