jonom / silverstripe-focuspoint

Module for improving automatic image cropping in SilverStripe. Adds simple art-direction control by allowing you to set and crop from a focus point instead of the centre point of an image.
MIT License
109 stars 48 forks source link

2nd fix prevent [Notice] for #98 #103

Closed lerni closed 2 years ago

lerni commented 2 years ago

with https://github.com/jonom/silverstripe-focuspoint/commit/560254cfc31831b38a4a88483ecbb0b1e5052ad4 merged (4.0.2) now we see [Notice] Undefined index: Width instead of [Emergency] Uncaught Error: Call to a member function getWidth() on array

lerni commented 2 years ago

Even tough this prevents the Notice, I'm under the impression, it can lead to empty return - need to verify this a bit closer.

lerni commented 2 years ago

Thanks @micschk - your suggestion looks sensible - I need some time to test. I now saw https://github.com/AirNZ/silverstripe-focuspoint/commit/fe837444860f2205a6de69bd997be7151c1521cf from @mikenz which is longer but for me a bit easier to read.

edit: and now I saw your last comment :wink:

lerni commented 2 years ago

Follow up on https://github.com/jonom/silverstripe-focuspoint/pull/105