I am using focal point with media integration.
First time image upload, focal point set and save workflow is working fine.
Now when someone tries to edit image using media field, edit form shows image applied with "focal_point_preview" image style.
This doesn't allow to change focal point outside it's preset area.

I have attached a patch that adds checkbox as a configuration, whether we should see original image or image style applied image.

Comments

mohit_aghera created an issue. See original summary.

mohit_aghera’s picture

StatusFileSize
new2.63 KB

Updating initial patch.

mohit_aghera’s picture

Status: Active » Needs review
bleen’s picture

This doesn't allow to change focal point outside it's preset area.

Can you explain this in greater detail? The focal point preview image preset simply scales down the original image to something more manageable to use in the admin interface. This means that there is no part of the image that falls "outside it's preset area" unless I am misunderstanding you.

mohit_aghera’s picture

StatusFileSize
new186.17 KB
new602.3 KB

@bleen
Currently with module's 7.x-1.0 version:
image edit form is like this in ctools modal Image style applied ( https://www.drupal.org/files/issues/image-style-applied.png )
In this small image, if we want to change focal point complete opposition to current focal point, it won't show rest of the image.

So i have added one checkbox option that allows to disable image style "focal_point_preview" on edit page.
After applying patch, it will show whole image and we can update focal point in opposite side of image.
something like this https://www.drupal.org/files/issues/original-image.png

bleen’s picture

I see the issue you are having ... basically the thumbnail that you are seeing in the ctools modal does not show the entire image and thus the editor cannot put the focal point where he/she wants to.

Unfortunately the solution you are proposing is not the correct solution. There are two possible problems:

1) The form being displayed in the ctools modal is NOT using the focal point preview image style to display the thumbnail. (In truth you can use any image style as the thumbnail has the same aspect ratio as the original image).

2) You are using the focal_point preview image style but that image style has been altered to display the thumbnail image as a square resulting in an image that has a different aspect ratio.

Finally, you can alter the form and use any image style that you desire. This is not an option that I would add to the focal point settings though.

mohit_aghera’s picture

@bleen

1) The form being displayed in the ctools modal is NOT using the focal point preview image style to display the thumbnail. (In truth you can use any image style as the thumbnail has the same aspect ratio as the original image).

I tried to check that using inspect element and noticed that it is using image style "focal_point_preview", so i thought it is designed by that way.
As you mentioned, other work around was that modify "focal_point_preview" image style so that it should show image in proper aspect.

bleen’s picture

Status: Needs review » Closed (works as designed)
capellic’s picture

@bleen

I know this is a closed ticket and it has been closed for quite some time, but I'm here to point out that matching the focal point preview image style - the existing one or a custom one - doesn't really work in our case.

We're using the Image Media Type to provide images across many design patterns, from heros to cards that have display ratios ranging from panoramic to portrait. We reuse a media field across entities that refers to the Image Media Type. Therefore every one of these media editor experiences is using the same preview image. All of these patterns have different image ratio needs. There's no way we can update the preview image style to match the image ratio of the design pattern.

One solution would be to add a Focal Point effect that didn't require cropping. I know this is somewhat counter-intuitive, but it would allow us to use the crosshairs to define the focal point. In fact a "Focal Point Scale" would get it done.

capellic’s picture

Ooookay so my brain wasn't fully functional when I left my previous comment.

I don't need a preview image that needs to use the existing Focal Point crop. Instead I'm now using the Large (480x480) Image Style that came with Drupal while using the Image (Focal Point) widget.

Works great!