I have the following simple setup:
Filesystem: Images (local folder)
Base URL: @web/assets/img
Asset Volume: Thumbnails which uses the above FS
Subpath: thumbnails
If the Subpath is not set then PDF Transform works fine, but with the Subpath set then PDF Transform generates a new Asset always, i.e. it doesn't use the previously generated image.
The reason appears to be in the render function (PdfTransformService.php) as below:
The issue is that the fileExists is being checked against the filesystem which is only the basepath and doesn't include the subpath. If the $fs->fileExists is changed to $volume->fileExists then the full path is used and the generated image is returned rather than a new asset.
I have the following simple setup: Filesystem: Images (local folder) Base URL: @web/assets/img
Asset Volume: Thumbnails which uses the above FS Subpath: thumbnails
If the Subpath is not set then PDF Transform works fine, but with the Subpath set then PDF Transform generates a new Asset always, i.e. it doesn't use the previously generated image.
The reason appears to be in the render function (PdfTransformService.php) as below:
The issue is that the fileExists is being checked against the filesystem which is only the basepath and doesn't include the subpath. If the
$fs->fileExists
is changed to$volume->fileExists
then the full path is used and the generated image is returned rather than a new asset.Do you want me to create a PR?