symphonycms / jit_image_manipulation

Just in Time Image Manipulation for Symphony CMS
http://symphonyextensions.com/extensions/jit_image_manipulation/
Other
25 stars 42 forks source link

Resize and crop, only crops #121

Open vdcrea opened 8 years ago

vdcrea commented 8 years ago

It seems that "resize and crop / crop to fill recipe / mode 2" only crops images, without resize. Or am I mistaken?

vdcrea commented 8 years ago

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.

nitriques commented 8 years ago

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)

vdcrea commented 8 years ago

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:

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.

nitriques commented 8 years ago

Ok thanks! I have a couple of unpushed commit. I should be able to push them today. Thanks!

nitriques commented 8 years ago

Hey @vdcrea ! After pulling my hair a lot, I think I've found it! Wanna test the patch ?

vdcrea commented 8 years ago

Thx Nicolas! Sure I will test tonight after work.

nitriques commented 8 years ago

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 ;)

vdcrea commented 8 years ago

Ok, for now I have strange result with last commit (931cf04):

2/350/400/5/ccc 2-350-400-5-ccc

From this original file original

I will be happy to test your next version ;-) Cheers and thanks for your work

nitriques commented 8 years ago

Yeah last commit is not yet stable... Can you please just test the mentioned commit please ? Thanks!

nitriques commented 8 years ago

@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

vdcrea commented 8 years ago

This is just PERFECT! :-D Thank you very much for this awesome fix.