jit_image_manipulation
jit_image_manipulation copied to clipboard
Resize and crop, only crops
It seems that "resize and crop / crop to fill recipe / mode 2" only crops images, without resize. Or am I mistaken?
If it s the case, the error could come from filters/filters/filter.resizeandcrop.php
Line 55/56 $src_r and $dst_r seems to be the same, both ratios are calculated from meta width and meta height, and not with params.
Results must be called with meta value, as meta should prevent upscalling.
The problems I see right now are related to division by 0. Please make sure to disable the cache option or manually clear the cache between test runs ;) (I got bitten by that)
I have tested the last integration branch, using the url params. A rule of /2/200/200/5/fff/ output an imagine a 200 x 300 px, the source image is cropped at position with no resize. I thought the rule 2 did the following operations:
- scale source image respecting ratio so the smallest side of the image is 200px
- then crop the outer largest sides to output the expected size from params
Position param has no effect on rule 3. With the rule /3/900/900/7/fff/ and /3/900/900/7/ the output is a cropped image, not in position 7, but in position 1.
Ok thanks! I have a couple of unpushed commit. I should be able to push them today. Thanks!
Hey @vdcrea ! After pulling my hair a lot, I think I've found it! Wanna test the patch ?
Thx Nicolas! Sure I will test tonight after work.
Thanks a lot! I have more commits coming. Trying to refactor the whole base code because right now, it's cryptic and easy to break ;)
Ok, for now I have strange result with last commit (931cf04):
2/350/400/5/ccc
From this original file
I will be happy to test your next version ;-) Cheers and thanks for your work
Yeah last commit is not yet stable... Can you please just test the mentioned commit please ? Thanks!
@vdcrea Can you please test the latest integration
branch ? All bugs should be done. I've made extensive testing and refactored all filters. Thanks ! cc @brendo @michael-e
This is just PERFECT! :-D Thank you very much for this awesome fix.