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

Merged
merged 4 commits into from
Feb 8, 2025

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!

@janko
Copy link
Owner

janko commented Feb 8, 2025

Great, thanks!

Such bizarre test failures!

Yeah, just ignore those, I'll look into them later.

@janko janko merged commit 8490530 into janko:master Feb 8, 2025
8 of 10 checks passed
@brendon
Copy link
Contributor Author

brendon commented Feb 9, 2025

Would it be possible to get a gem release with this fix in it as I'd be keen to get it into production :D

@janko
Copy link
Owner

janko commented Feb 10, 2025

Released in 1.14.0 🚀

@brendon
Copy link
Contributor Author

brendon commented Feb 10, 2025

Thanks @janko, deploying now :D

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.
2 participants