Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rules not working in V2.2.1 #85

Open
bmeissn opened this issue Aug 30, 2023 · 1 comment
Open

Rules not working in V2.2.1 #85

bmeissn opened this issue Aug 30, 2023 · 1 comment

Comments

@bmeissn
Copy link

bmeissn commented Aug 30, 2023

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
Copy link
Owner

xperseguers commented Feb 23, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants