Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Resize images based on aspect ratio?
djh_
New
Hi.
I want to tweak the image resizer to differentiate between 'portrait' and 'lanscape' shots. Basically, if a shot is taller than it is wide, I want it to only occupy about 45 per cent of the post container, meaning that a user could post two portrait shots side by side at the same combined width as a single landscape image.
Is this possible? I've looked at the resizer code in global.js and have no idea what it's doing.
D.
0
Comments
Welcome to the community!
What version number of Vanilla are you running?
I am sure it is possible. The resizing code and approach would be different based on your version of Vanilla.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Cheers for the quick reply.
I'm running 2.1b1.
You can hook in after the image has been resized using the following JS.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks for this! In the end I went with:
(how do you input code in this thing?)
@djh_, I edited your post and put the code in a block with three tildes before and after the code like
~~~
.Add Pages to Vanilla with the Basic Pages app