public function setResource(ImageResourceInterface $resource)
    {
        $this->resource = $resource;

        if ($this->resource instanceof ImageFilterableInterface) {
            $this->filterResolver = new FilterResolver($this->resource->loadFilters());
        }
    }