Is there another way to get the custom image size, or to extend the ImageSet or would it then be better to not use the ImageSet and just create a custom type for it?
Hmm, we did and we also get the correct response from the API, but the problem is in the SPA frontend. The ImageSetImpl there only has getOriginal() and getThumbnail() methods and there doesn’t seem to be any way to use the other image sizes.
If you are getting the additional imageset sizes in the API, you should be able to retrieve those values in the front end. Could you share how you are trying to retrieve this?
We are using react + typescript, then to get the image url we do this: page.getContent<ImageSet>(imageReference)?.getOriginal()?.getUrl(). ImageSet is imported like this: import {ImageSet} from "@bloomreach/spa-sdk";
Ideally I would like to do something like: page.getContent<ImageSet>(imageReference)?.getSmall()?.getUrl()
or: page.getContent<ImageSet>(imageReference)?.getCustomSize('small')?.getUrl()
We could probably extract the data if we create a custom interface and using that for getting the content: