adaptTo returns null in Sling model
Hi,
I am trying to adapt a resource into an Image.class object in my Sling model, but I always get `null` for `image1` even though the resource is correctly returned with all its properties. I tried using `resourceResolver` and `request` below.
@Model(
adaptables = SlingHttpServletRequest.class,
adapters = {Image.class, ComponentExporter.class},
resourceType = {TestImageModel.RESOURCE_TYPE},
defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class TestImageModel extends AbstractComponentImpl implements Image {
private SlingHttpServletRequest request;
private ResourceResolver resourceResolver;
//...
Image image1 = resourceResolver.getResource("/content/aladin/sean/jcr:content/root/container/testimage/image1").adaptTo(Image.class);
//...
Image image1 = request.getResource().getChild("image1").adaptTo(Image.class);
//...
}
I believe the resource path of "/content/aladin/sean/jcr:content/root/container/testimage/image1" should have all the required properties to adapt to Image class, per below.

What am I missing here to get the actual Image object instead of `null`? I am using AEMaaCS.
Thank you,