Introduce a focus area

Created on 19 October 2016, about 8 years ago
Updated 27 December 2023, about 1 year ago

Problem/Motivation

We have created a new module focal_point_focus which is based on focal_point. The goal was to give editors the possibility to crop and set focus_point together.

So editors are able to stretch a rectangle first on an image and then set a focal point.

It can be checked out from here: https://github.com/BurdaMagazinOrg/module-focal_point_focus

What do you think about it? Would you add this to the focal_point repo as a submodule or should we create a new d.o. project?

✨ Feature request
Status

Needs review

Version

2.0

Component

Other Code

Created by

πŸ‡©πŸ‡ͺGermany chr.fritsch πŸ‡©πŸ‡ͺπŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada bgilhome Victoria

    The entity definition update for the 'crop' entity type in focal_point_update_8005() isn't working, it gives an error The "" entity type does not exist.

    I've removed it from the update function. This means the Status report will show a Mismatched entity and/or field definitions error, that's a to-do to fix.

    Also for some reason I needed to add a setName() call to the added focal_point_area base field in focal_point_entity_base_field_info_alter(), to avoid an Undefined array index "field_name" warning.

  • πŸ‡¨πŸ‡¦Canada bgilhome Victoria

    Ignore the above, all the entity definition update base field definition update needed was a call to the setTargetEntityTypeId method and I added a call to setProvider for good measure.

    Updated patch and interdiff from #21 attached.

  • πŸ‡¨πŸ‡¦Canada bgilhome Victoria

    Added a check to ensure CSS width/height of the preview image is set, otherwise there'll be errors calculating relative coords of the focal area (divide by 0). Updated patch & interdiff attached.

  • πŸ‡¨πŸ‡¦Canada bgilhome Victoria

    Re-roll from 2.x-dev.

  • Adding focal_point_area.js back to patch. In focal_point_area.js, replaced reference to jQuery once() with Drupal once().

  • Status changed to Needs review about 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.2 & MySQL 8
    last update about 1 year ago
    Patch Failed to Apply
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Moving this to the 2.x branch, which is where new features are being added.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Wouldn't you just use https://www.drupal.org/project/image_widget_crop β†’ then perhaps?

    If yes, we could close this won't fix and link the module as alternative on the module page?

Production build 0.71.5 2024