Bug #80169

Epic #77810: Improve (responsive) image handling

Aspect ration is wrong in media element (fal) details

Added by Joerg Boesche over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Image Cropping
Target version:
Start date:
2017-03-07
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

2 Issues with the aspect ratio with the image manipulation tool.

  1. After editing the image with the image manipulation wizard and closing (Button: accept) the overlay, the aspect ratio is not updated in media view.
  2. After edtiting the image with the image manipulation wizard and saving the content element, the aspect ratio is wrong in media view.

See attached files.

image-manipulation-wizard_ratios-before-saving-content-element.jpg View - Aspect ratio in wizard (24.1 KB) Joerg Boesche, 2017-03-07 13:39

image-manipulation-wizard_before-saving-content-element.jpg View - Closing the wizard and before save (35.9 KB) Joerg Boesche, 2017-03-07 13:39

image-manipulation-wizard_after-saving-aspect-ratio.jpg View - After saving the ce and open the media (27 KB) Joerg Boesche, 2017-03-07 13:39

Associated revisions

Revision 9c8592ab (diff)
Added by Helmut Hummel over 2 years ago

[BUGFIX] Update selected ratio in preview element

When selecting a different ratio and accepting the image manipulation,
not only the image thumbnails, but also the selected ratio should be updated.

Also set the selected ratio correctly when initializing the image manipulation
and set the value even if selected ratio is not defined in TCA but is present
in allowed aspect ratios.

Also always set crop area from saved collection.

Resolves: #80169
Releases: master
Change-Id: I63c24e14b724c3f47ff3101afb4bcb56983c1b28
Reviewed-on: https://review.typo3.org/51979
Tested-by: TYPO3com <>
Reviewed-by: Joerg Boesche <>
Tested-by: Joerg Boesche <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51979

#2 Updated by Helmut Hummel over 2 years ago

After edtiting the image with the image manipulation wizard and saving the content element, the aspect ratio is wrong in media view.

I can't reproduce that. Can you post your configuration here?

#3 Updated by Joerg Boesche over 2 years ago

Helmut Hummel wrote:

After edtiting the image with the image manipulation wizard and saving the content element, the aspect ratio is wrong in media view.

I can't reproduce that. Can you post your configuration here?

This is my current configuration in EXT:example/Configuration/TCA/Overrides/sys_file_reference.php

$allowedAspectRatios = [
    '16:9' => [
        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.16_9',
        'value' => 16 / 9
    ],
    '3:2' => [
        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.3_2',
        'value' => 3 / 2
    ],
    '4:3' => [
        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.4_3',
        'value' => 4 / 3
    ],
    '1:1' => [
        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.1_1',
        'value' => 1 / 1
    ],
    'NaN' => [
        'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_wizards.xlf:imwizard.ratio.free',
        'value' => 0.0
    ],
];
$cropArea = [
    'x' => 0.1,
    'y' => 0.0,
    'width' => 1.0,
    'height' => 0.8,
];
$focusArea = [
    'x' => 1 / 3,
    'y' => 1 / 3,
    'width' => 1 / 3,
    'height' => 1 / 3,
];

$coverAreas = [
         [
             'x' => 0.05,
             'y' => 0.85,
             'width' => 0.9,
             'height' => 0.1,
         ]
     ];

$GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config'] = [
    'type' => 'imageManipulation',
    'cropVariants' => [
        'desktop' => [
            'title' => 'Desktop',
            'allowedAspectRatios' => $allowedAspectRatios,
            'cropArea' => $cropArea,
            'focusArea' => $focusArea,
            'coverAreas' => $coverAreas
        ],
        'tablet' => [
            'title' => 'Tablet',
            'allowedAspectRatios' => $allowedAspectRatios,
            'cropArea' => $cropArea,
            'focusArea' => $focusArea,
            'coverAreas' => $coverAreas
        ],
        'mobile' => [
            'title' => 'Mobile',
            'allowedAspectRatios' => $allowedAspectRatios,
            'cropArea' => $cropArea,
            'focusArea' => $focusArea,
            'coverAreas' => $coverAreas
        ],
    ],
];

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51979

#5 Updated by Helmut Hummel over 2 years ago

ok, that helped. I could reproduce it now

#6 Updated by Helmut Hummel over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF