Resize pad simply takes the size you have given and applies even distribution of padding to fit the image to the given aspect ratio.
The crux of the method takes place here. Theoretically it would be possible to add the AnchorPosition enum calculations to pad in order to allow for your need.
I reckon you could solve that with flexbox or using table, table-cell since that allows alignment. I just knocked up the first thing I thought of.
You have definitely given me something to think about though. It would certainly be a nice addition to be able to determine the padding direction so I'll try and get that added sometime soon.
Padding and imageprocessor
Does anyone know if it's possible to decide where the padding is applied when running i pad mode ?
Right now it's distributed equally top/bottom and left/right.
But if I need to have 3 images scaled to fit within a crop and to align to bottom, I kinda need to distribute all padding from the top.
http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/resize.html
I'm afraid not at present.
Resize pad simply takes the size you have given and applies even distribution of padding to fit the image to the given aspect ratio.
The crux of the method takes place here. Theoretically it would be possible to add the AnchorPosition enum calculations to pad in order to allow for your need.
https://github.com/JimBobSquarePants/ImageProcessor/blob/V2/src/ImageProcessor/Imaging/Resizer.cs
https://github.com/JimBobSquarePants/ImageProcessor/blob/V2/src/ImageProcessor/Imaging/AnchorPosition.cs
If you fancy having a go I'm more than willing to accept pull requests. I don't have the time sadly to do it myself just now.
This looks like a problem you could conceivably solve using CSS though.
http://jsfiddle.net/v7og4r9w/
Thanks.
I knew about the CSS trick and it did solve the problem, for now.
The only downside with the CSS trick is that it requires a fixed height.
No worries,
I reckon you could solve that with flexbox or using table, table-cell since that allows alignment. I just knocked up the first thing I thought of.
You have definitely given me something to think about though. It would certainly be a nice addition to be able to determine the padding direction so I'll try and get that added sometime soon.
is working on a reply...