Skip to content
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

Fix bug in resize_to_cover where the image is provided as a string #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

brendon
Copy link
Contributor

@brendon brendon commented Feb 8, 2025

This appears to be a good fix. My original implementation always assumed image existed because we didn't use resize_to in the method name:

if operations.dig(0, 0).to_s.start_with?("resize_") &&
loader.empty? &&
supports_resize_on_load?
accumulator = source
else
accumulator = load_image(source, **loader)
end

Not sure if there are any functional differences in how we load the image here and how it's loaded in processor.rb.

Probably the better fix would be to use another system for determining which methods need the image to be loaded first rather than relying on the method name.

Closes #134

@brendon
Copy link
Contributor Author

brendon commented Feb 8, 2025

Such bizarre test failures!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resize_to_cover on Vips makes incorrect size images.
1 participant