betty icon indicating copy to clipboard operation
betty copied to clipboard

Add focal areas to files

Open bartfeenstra opened this issue 1 month ago • 0 comments

Extend files with

  • a single focal point that locates the center of the primary subject if the file can be displayed in 2D
  • a box that determines the minimum area that must be shown
  • or perhaps a single focal area. For focal points all coordinates are identical.

Then extend our image resizing code to take these two settings into account so that if the box exists, that area is always shown in resized images, and that the focal point is as much in the center as possible. The area outside the box MAY be cropped if needed. The focal point, if it exists, then determines how much is cropped outside each side of the box. E.g. if the focal point is near the bottom right corner of the box, the image will primarily be cropped from the top and left sides.

The solves the problem that if a file is a photo of someone and their face is off center, with simple cropping we may not see the face in the resized image.

Also, we may need to add this to a new file reference bridge entity, so these focal settings may be different per entity referencing the file, e.g. when multiple people appear in the same photo.

Finally, load Gramps focus areas into these new file references.

bartfeenstra avatar Jun 05 '24 12:06 bartfeenstra