Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to transform external images if using servd as both storage and transformer? #70

Open
zhua89cc opened this issue Sep 5, 2023 · 1 comment

Comments

@zhua89cc
Copy link

zhua89cc commented Sep 5, 2023

Question/Enhancement:

We are using servd both as a hosting service and asset management for a new craft site we are building. We have an entry type that pulls in videos from youtube and are using imager x to transform both the image on the entry type but as a fallback if the entry doesn't haven image we are getting the Youtube thumbnail and using that as a fallback. I read in the docs that if we're using servd as our transformer it will only work for images stores on the servd assets platform so in this case trying to transform any external image urls are returning null. We use a shared component library across sites so in our image twig template it isn't expecting the craft.imagerx.transform method to really return null. Is there a workaround or potential added feature of being able to transform external images down the pipeline anytime soon?

Here's our imager-x.php config

`$config = [
'transformer' => 'servd',
'fallbackImage' => 'https://s3.amazonaws.com/uschamber.com-assets/assets/images/generic-missing_2020-12-10-141105.gif',
'cacheRemoteFiles' => true,
'cacheDuration' => 1209600,
'cacheDurationRemoteFiles' => 1209600,
'cacheDurationExternalStorage' => 1209600,
];

return $config;`

Craft Version: 4.5.1
Servd Asset Storage: 3.4.10

@mattgrayisok
Copy link
Collaborator

Although Servd's image transformer can't pull images in from external sources, it would be better for our transformer to fall back to Craft's default transform mechanism when presented with a URL it can't handle to see if that can do it instead.

I'll see if we can drop that in in a way that also works ok with Imager et al.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants