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 22 forks source link

Rules not working in V2.2.1 #85

Open bmeissn opened 1 year ago

bmeissn commented 1 year ago

The usergroup "Redakteur" (ID = 1) shall have lower resolutions for the uploaded images. These rule-settings are not working for users with the assigned group "Redakteur", instead the general settings will be taken.

My system versions and settings:
Typo3: 10.4.36
PHP: 7.4.33
image_autoresize: 2.2.1

General Settings in image_autoresize:
directories: 1:/,user_uploads/
threshold: 5M
filetypes: jpg, jpeg, bmp, png, gif, tif, tiff
max-width: 5000
max-height: 5000
max-size: 100M

auto_orient: 1
keep_metadata: 1

Rule Settings:
usergroup: Redakteur
directories: user_uploads/
threshold: 1M
filetypes: jpg, jpeg, bmp, png, gif, tif, tiff
max-width: 1000
max-height: 1000
max-size: 1M

The concerning definitions in the image_autresize.config.php:

return [
    'directories' => '1:/,user_uploads/',
    'file_types' => 'jpg,jpeg,png,bmp,gif,tif,tiff',
    'threshold' => '5M',
    'max_width' => '5000',
    'max_height' => '5000',
    'max_size' => '100M',
    'auto_orient' => '1',
    'conversion_mapping' => 'ai => jpg,bmp => jpg,pcx => jpg,tga => jpg,tif => jpg,tiff => jpg',
    'keep_metadata' => '1',
    'resize_png_with_alpha' => '0',
    'rulesets' => [
        'data' => [
            'sDEF' => [
                'lDEF' => [
                    'ruleset' => [
                        'el' => [
                            '64eecf21bad99932644077' => [
                                'container' => [
                                    'el' => [
                                        'title' => [
                                            'vDEF' => 'Redakteure',
                                        ],
                                        'usergroup' => [
                                            'vDEF' => '1',
                                        ],
                                        'directories' => [
                                            'vDEF' => 'user_uploads/Bilder',
                                        ],
                                        'file_types' => [
                                            'vDEF' => 'bmp,gif,jpeg,jpg,png,tif,tiff',
                                        ],
                                        'threshold' => [
                                            'vDEF' => '1M',
                                        ],
                                        'max_width' => [
                                            'vDEF' => '1000',
                                        ],
                                        'max_height' => [
                                            'vDEF' => '1000',
                                        ],
                                        'max_size' => [
                                            'vDEF' => '1M',
                                        ],
                                        'keep_metadata' => [
                                            'vDEF' => '',
                                        ],
                                        'conversion_mapping' => [
                                            'vDEF' => '',
                                        ],
                                    ],
                                ],
                                '_TOGGLE' => '0',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];
xperseguers commented 7 months ago

I spot a few problems in your configuration file, possibly fixing them will make the rules work...

You wrote:

General Settings in image_autoresize:
directories: 1:/,user_uploads/

This is supposed to be

directories: 1:/user_uploads/

or

directories: 1:/,1:/user_uploads/

(makes little sense but...)

instead.

Furthermore, you wrote:

usergroup: Redakteur
directories: user_uploads/

This is logically this instead:

directories: 1:/user_uploads/

=> the directory is expected to be a FAL identifier, each time!