-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Only pass crop parameter when ratio is specified #2
Comments
When you crop an image, you get a FileVersion class, which doesn't support file methods and hence you can't create a thumbhash out of a cropped image. In order to still support cropped images, you can supply the ratio to the original file method call like so: https://github.com/tobimori/kirby-thumbhash#cropped-images This is what the plugin uses cropping for. |
Whoaa that was quick! 🚀😄 Sorry, I had an error in my original question. I'm asking if |
You could try modifying the line like this and still have ratio/crop support: |
I don't need crop support 😄 I want it off by default |
Then just set it to false. |
Sure, that's what I did. Do you accept PRs? |
Try replacing the script with the following: Does the error still occur with that? |
Yes it's working with the code above! |
crop: true
Hi @tobimori ,
thanks so much for this beautiful plugin!
Today I suddenly ran into memory issues. While source-diving and playing around, I noticed that in my case, the
$file->thumb()
doesn't actually do any downsizing when cropping is set totrue
, leading to Memory allocation errors.kirby-thumbhash/classes/ThumbHash.php
Line 45 in cfc4896
Setting that to
false
magically fixed it. While this of course doesn't really make sense and seems to be pointing towards an underlying issue in my Kirby install, I'm still wondering what the reasoning is behind setting cropping totrue
?The text was updated successfully, but these errors were encountered: