Focus area improvement
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).
Updated by Tobias Pinnekamp 11 months 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.