Closed (fixed)
Project:
Focal Point
Version:
2.x-dev
Component:
Other Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2018 at 06:04 UTC
Updated:
21 Jul 2024 at 14:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bleen commentedI don't see why we couldn't do this ... it makes the most sense to create a new image effect (I think).
Patches welcome :)
Comment #3
mike.davis commentedI recently had to do this for a D7 site which I needed this for.
Here is my patch for the D7 version - I haven't got a D8 site with this on to be able to provide a patch for the D8, but may this will provide a starting point for this?
Comment #4
bleen commentedThe patch in #3 looks pretty good, but I'd like this to go into the D8 version first ...
Comment #5
azovsky commentedLooks like a "scale by width/height only" in case WITH Focal Point makes no sense. An image remains with the same aspect ratio only smaller (larger), no any "cropping" to use a focal point.
I think, this task can be closed.
Comment #6
hugronaphor commentedAgree with @azovsky here.
The title of this ticket fits into my needs so I'll follow up here.
My use case:
I want to crop the image based on the Focal Point but I want to keep the original height of the image.
More specifically, we use the image as a background and if you have a ration of 19:4 for example on mobile you would get a very squeezed (image).
So, what I need - is the ability to crop the image specifying the width but keeping the same heigh.
I'll leave here the Image Effect(focal_point_crop_by_width) I came up with(8.x)
Comment #7
bramdriesenThis works as expected ;)
Comment #8
damienmckennaInstead of adding a new plugin, how about modifying the current plugins to allow only submitting one dimension?
Comment #9
damienmckennaThis applies cleanly and appears to work as well on the 2.x branch as it does on the 8.x-1.x branch.
That said, should we rename this to "Focal Point crop by height only"?
Comment #10
hugronaphor commentedIf we're talking about work in #6, suggested "Focal Point crop by height only" is not right but the opposite: "Focal Point crop by width only" (In patch: Focal Point Crop by Width)
Comment #12
rajeshreeputraMerged, release to follow shortly.
Comment #13
bramdriesenThnx
Comment #15
dinazaur commentedWe should definitely rename it to "Focal Point crop by width only". I'm not sure why this was merged.
The issue description clearly says "This is available in core's ScaleImageEffect. Is this something that could be added". ScaleImageEffect maintains the image aspect ratio instead of keeping the original height. The thing that was merged should be in a separate issue and is not related to this issue.
This should've been done as suggested @DamienMcKenna in #8.
Comment #16
rajeshreeputraHi @dinazaur, I'm not sure if modifying the current plugin to allow only providing the width or height is the right approach. Can we create separate issue to implement this?