private function getWatermark(ImagineInterface $imagine): ?ImageInterface
    {
        $resource = null;
        if ($this->getMarkFilepath() !== null) {
            $resource = fopen($this->getMarkFilepath(), 'rb');
        } elseif (\is_string($this->markContent)) {
            $resource = 'a'; // TODO: create resource.
        } elseif (\is_resource($this->markContent)) {
            $resource = $this->markContent;
        }

        if ($resource === null) {
            return null;
        }

        return $imagine->read($resource);
    }