jonom/silverstripe-focuspoint

Focuspoint doesn't play well with heyday/responsive-images module

wernerkrauss opened this issue · 6 comments

I tried to combine focuspoint with https://github.com/heyday/silverstripe-responsive-images but it doesn't play well:

[User Error] Uncaught InvalidArgumentException: Filename FocusFillWzkwMCw1NjJd/DSC-2010.jpg that should be used to cache a resized image is invalid

Backtrace:

Image->cacheFilename(FocusFill,900,562)
call_user_func_array(Array,Array)
Image.php:724
Image->getFormattedImage(FocusFill,900,562)
call_user_func_array(Array,Array)
ResponsiveImageExtension.php:114
Heyday\ResponsiveImages\ResponsiveImageExtension->createResponsiveSet(Array,Array,responsivegalleryset)
ResponsiveImageExtension.php:67
Heyday\ResponsiveImages\ResponsiveImageExtension->__call(responsivegalleryset,Array)
Heyday\ResponsiveImages\ResponsiveImageExtension->responsivegalleryset()
call_user_func_array(Array,Array)
Object.php:748
Object->__call(ResponsiveGallerySet,Array)
ViewableData.php:446
Image->ResponsiveGallerySet()
ViewableData.php:446
ViewableData->obj(ResponsiveGallerySet,,,1)
ViewableData.php:519
ViewableData->XML_val(ResponsiveGallerySet,,1)

my config for responsive images module:


After: 'silverstripe-responsive-images/*'

Heyday\ResponsiveImages\ResponsiveImageExtension:
sets:
ResponsiveGallerySet:
method: FocusFill
arguments:
'(min-width:1000px)': [900,562]
'(min-width:800px)': [600,375]
'(min-width:400px)': [400,250]
default_arguments: [900,562]

So i try to use FocusFill as a default method for generating that image set. Fill works fine.

From what i see in the code it's because we don't have a generateFocusFill method available.

CroppedFocusedImage also throws an error the first time, parameter missing...

jonom commented

Hi @wernerkrauss I haven't got a lot of time to investigate stuff like this at the moment unfortunately, but if you want to dig in to it and submit a PR please feel free!

xini commented

hey @wernerkrauss have you ever been able to fix this? Cheers

@xini Nope, i downgraded FocusPoint for this specific project and didn't investigate much further. My compsoer.json has this entries:

    "jonom/focuspoint": "^1.1.0",
    "heyday/silverstripe-responsive-images": "^1.0.0",
xini commented

@wernerkrauss yeah, same... ;)

xini commented

@wernerkrauss thanks. WPP-Public/akqa-nz-silverstripe-responsive-images#18 seems to solve this once and for all.