jit_image_manipulation icon indicating copy to clipboard operation
jit_image_manipulation copied to clipboard

Resize and crop, only crops

Open vdcrea opened this issue 8 years ago • 11 comments

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

vdcrea avatar May 28 '16 15:05 vdcrea

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.

vdcrea avatar May 28 '16 15:05 vdcrea

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)

nitriques avatar May 30 '16 01:05 nitriques

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.

vdcrea avatar May 30 '16 06:05 vdcrea

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

nitriques avatar May 30 '16 14:05 nitriques

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

nitriques avatar Jun 01 '16 02:06 nitriques

Thx Nicolas! Sure I will test tonight after work.

vdcrea avatar Jun 02 '16 08:06 vdcrea

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

nitriques avatar Jun 02 '16 16:06 nitriques

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

vdcrea avatar Jun 02 '16 21:06 vdcrea

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

nitriques avatar Jun 02 '16 22:06 nitriques

@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

nitriques avatar Jun 07 '16 00:06 nitriques

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

vdcrea avatar Jun 07 '16 20:06 vdcrea