xperseguers / t3ext-image_autoresize

TYPO3 Extension image_autoresize. Simplify the way your editors may upload their images.
https://extensions.typo3.org/extension/image_autoresize
GNU General Public License v3.0
16 stars 23 forks source link

Rule sets doesn't work properly #51

Closed wjumelleUS closed 2 years ago

wjumelleUS commented 3 years ago

Hi, I have image_autoresize v2.0.3 on TYPO3 8.7. I set 4 directories to "General" tab option with 1:/.

When I set up rules on "Rule sets" tab, i write a rule on a subdirectory of a directory specified on the "General tab" with differents "File size treshold" and "Image dimensions" it seems to doesn't work. (treshold : 10M ; max width : 10000 ; max height : 10000)

Cause I go to the subdirectory to import a file (1950*1300 2Mo), but this file is resized every time following the rule defined on "General" tab.

My "General" tab option directory looks like it : 1:/fileadmin_x/fichiers/

My rule on "Rule sets" tab option for subdirectory looks like it : 1:/fileadmin_x/fichiers/subdir/subdir2/subdir3/

Any idea ? Thank you in advance

Gloumi commented 3 years ago

Hello, same issue here with version 1.9.2.

Here is my configuration :

image

Capture d’écran 2021-04-01 à 17 30 00

My images are always processed with the global configuration and my rule set is not working.

xperseguers commented 3 years ago

Works fine for me. Could you try upgrading your rule to use a FAL identifier instead? So instead of fileadmin/xxx/ write 1:/xxx/

xperseguers commented 3 years ago

@wjumelleUS Unsure about your use case...

I'm not sure what your actual use case is but I could imagine that you've configure your rule with a 10M threshold with the idea that below that the file should not be resized at all in this directory? But then since the rule doesn't apply it falls back to the general rule which is likely to have a lower threshold. Just an idea.

To report a bug please describe your general rule, your specific rule, then describe the file you try with (possibly upload it if it helps), then explain what you expect to happen and finally what is happening. Then it gets easier to understand and see if the problem is in the extension, in some misunderstanding of how it works (documentation could then be enhanced) or ...

joniroutypo3 commented 3 years ago

Hello, I tried with these settings : extension version 1.9.2 and TYPO3 9.5.26 My test file is a jpg, with size of 2500x1666 px, 839ko

Capture d’écran 2021-05-24 à 22 59 33 Capture d’écran 2021-05-24 à 22 59 42 Capture d’écran 2021-05-24 à 23 00 12

@xperseguers, i did some X-debug (in "trash mode") on "/typo3conf/ext/image_autoresize/Classes/Service/ImageResizer.php" file and i noticed that :

1/ if i used FAL identifier 1:/user_upload/phase_02/export/ in "Directories:" of my RuleSet and if i upload a file in fileadmin/user_upload/phase_02/export/349A3927_2500x1666.jpg the preg_match is null for the path. But he should.

Capture d’écran 2021-05-24 à 23 08 19 And the file is not optimized Capture d’écran 2021-05-24 à 23 13 06

2/ if i used "fileadmin/user_upload/phase_02/export/" in "Directories:" field of my RuleSet The preg_match give 1 :

Capture d’écran 2021-05-24 à 23 15 16

it work : Capture d’écran 2021-05-24 à 23 18 00

So, it seems that the FAL identifier is not well translated in filePath.

And my FAL identifier 1 is fileadmin

Capture d’écran 2021-05-24 à 23 24 03

I will try tomorrow on a fresh instance to see where it could be fixed.

@xavier have you the same behaviour in debug ? Which version do you use ?

xperseguers commented 3 years ago

@xavier have you the same behaviour in debug ? Which version do you use ?

I'm using the v2.1.1, the version you use (v1.9.2) is 1 year old, best would be to debug with either v2.1.1 or right away with master branch (in that case same state).