Project

General

Profile

Actions

Feature #81391

open

Focus area improvement

Added by Christian Toffolo almost 7 years ago. Updated about 4 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Image Cropping
Target version:
-
Start date:
2017-05-31
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.1
Tags:
Complexity:
Sprint Focus:

Description

Focus area should be instead a focus point like this: http://jonom.github.io/jquery-focuspoint/demos/helper/index.html
A point is simpler to handle than an area for both editors and developers.
(but maybe I'm failing to imagine an use case where an area is useful)

Also, Fluid viewhelpers f:media and f:image return an attribute 'data-focus-area' that is not useful because the coordinates are based on the original image size and the resulting image has been, most of the time, resized.

It's better to use coordinates of a singular focus point X/Y that represent a percentage of shift from the top/left corner or, in alternative, from the center o the image (or the crop area).

Actions #1

Updated by Riccardo De Contardi over 6 years ago

  • Category set to Image Cropping
Actions #2

Updated by Martin Kutschker over 5 years ago

Areas are useful if you make sure that the whole face of a person is visible, etc. So IMHO having only a singular point is not an enhancement.

Actions #3

Updated by Susanne Moog about 5 years ago

  • Tracker changed from Task to Feature
Actions #4

Updated by Tobias Pinnekamp about 4 years ago

I can see usages for both arguments. A single point is very easy to use. Having an area provides more control over what has to be visible at all times.

But I cannot find any single existing frontend library which would work "easily" with this approach. For every single one (which are not much tbh) out there you have to decode the json from data-focus-area and translate it to single data-attributes which in addition have to be calculated to provide the expected value for the library. Trying a CSS only approach with background-position is impossible due to the fact that the values of data-focus-area are not accessible in CSS.

I think it would be a good step forward to provide the values from data-focus-area as separate data-attributes. Then they are usable in CSS and if a JS library expects those kind of values there might be a config option to define to name of data-attribute for each value.
Or provide a Slot to hook into to manually change how the values are output. Then they also could be recalculated to fit the needs of the used JS lib.

Focus Areas in TYPO3 are a great feature. But I guess nobody uses them. Even me until yesterday. I reported this bug https://forge.typo3.org/issues/90437 yesterday which already has a Patch (great work for that). But the mentioned related patch set which caused this bug https://review.typo3.org/c/Packages/TYPO3.CMS/+/52313 is from April 2017. So focus areas haven't been usable for almost 3 years now.

So maybe this feature needs to be a bit more flexible to be used by people. Otherwise someone would have found that bug way before me.

Actions #5

Updated by Susanne Moog about 4 years ago

I guess the one most people actually use is https://extensions.typo3.org/extension/focuspoint

Actions

Also available in: Atom PDF