I wanted to get the absolute path of a file from the filesystem perspective but found no way to get this with the current API of the resourceManager.
I know you can get the Webserver URL to a resource with $this->resourceManager->getPublicPackageResourceUriByPath()
But there is no method to somehow get the filepath.
You can get the file content with file_get_contents(), so i tried different php functions like realpath() which only returns false since i guess it does not use Stream Wrappers like file_get_contents does.
I currently have written this method to get the path
Problem with resources is that they may be not on the system at all when cloudstorage is used (at least the public path can be anywhere). I would suggest to use file_get_contents to create a tempfile that is passed to imagemagick.
Other than that the package manager is able to tell you the full resources-path of the package via $package->getResourcesPath().