Hi,

Thanks for this super UX-driven module. This might not be a bug but here's what we're experiencing using focal point:

- After uploading a new file we'll position the focal point crosshairs.
- Previewing the focal point imagestyles works.
- After saving the node, the respective imagestyles on node view and across the site are showing up properly.

Then:

- After going back into a node we'll reposition the crosshairs of an already uploaded image.
- Previewing the focal point imagestyles works just fine.
- After saving the node, the respective imagestyles on node view and across the site do not change - ie. they still show the original focal point

It would appear as if the imagestyles are being hard cached or are not flushing somehow. Any ideas on what could be wrong? Thanks again.

Comments

pribeh created an issue. See original summary.

pribeh’s picture

Issue summary: View changes
attisan’s picture

Version: 7.x-1.0-beta6 » 7.x-1.x-dev
Priority: Normal » Major

same here. even if I enforce the removal of the styled images, using image_path_flush() the regenerated images still ignores the new focal point all together.

I do have a suspicion on media or file_entity being part of this misbehavior.

attisan’s picture

seems to me the trouble resides in the focal_point.effects.inc at line 129 through 131 in the focal_point_effect_crop_data function.

"else" always triggers if the file is not created while using the preview and thus overwrites the saved focal_point (set in line 122). So, no matter what updated focal point is set while saving the file, it will always be overwritten by the "guess" function.

function focal_point_effect_crop_data($image, $data) {
  $files = file_load_multiple(array(), array('uri' => $image->source));
  if (count($files)) {
    $file = reset($files);
    $focal_point = $file->focal_point;

    // Special handling for preview images.
    $parameters = drupal_get_query_parameters();
    if (!empty($parameters['focal_point'])) {
      $focal_point = focal_point_validate($parameters['focal_point']) ? $parameters['focal_point'] : $focal_point;
    }
    else {
      $focal_point = _focal_point_guess_default($file->fid);
    }

  ...

hth,
attisan

bleen’s picture

Status: Active » Closed (duplicate)

i'm going to mark this a duplicate of #2848694: Follow up for #2832030: Custom focal point overwritten by defautl data. even though this issue is older since there is a patch there... please test that patch and report back