-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Craft 5] Google Cloud Storage and IMGix not using Asset Volume Subpath in transform URL #403
Comments
I think this might be a bug |
I agree! I'm hoping it's easy for you to add the Sub Path to the output URL? |
Hi @khalwat any update on this? It's currently a blocker for showing the client some of our development work. If you need any further information to help with debugging, let me know :) Thanks! |
So I have been looking into it, the strange thing is it does look like the code takes into account the subfolder setting: // Account for volume types with a subfolder setting
// e.g. craftcms/aws-s3, craftcms/google-cloud
if ($volume->getFs()->subfolder ?? null) {
$subfolder = $volume->getFs()->subfolder;
$subfolder = Craft::parseEnv($subfolder);
return rtrim($subfolder, '/') . '/' . $assetPath;
} So I'm a little confused as to why this is not working already. |
Any chance we can do a quick video conf to check out your setup and perhaps put in some debug code to see what's going on? |
Hi Andrew, Unfortunately we're in different timezones, and I was out when your message came through. I think the difference here is that it's not a subfolder, it's a sub path
Sorry for the formatting I'm replying on my phone but I think |
Ahh my bad I didn't realise this was a scheduling app, I'll put in some availability for you. |
Fixed in the above commit. You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop-v5 as 5.0.1”, Then do a |
That's working for me in the control panel now, thumbnails and transformed images are showing up in the IO field and it's working on the front end too. Thank you! |
Question
Hi there,
I have 1 Filesystem (a Google Cloud Storage bucket) and 4 Image Volumes.
Each volume has a Subpath set, e.g. for Hero Images I have
images-hero
set as the Subpath.I have configured ImageOptimize to use the IMGix transformer but the URL to the uploaded images is missing the Subpath.
For example, if I go to the Assets folder view, the URL to an asset is:
https://storage.googleapis.com/<cloudstorage-bucket-name>/images-hero/example-image.jpg
but if i view the thumbnail, for example, the URL to the thumbnail image is:
https://<imgix source domain>.imgix.net/example-image.jpg?auto=compress%2Cformat&crop=focalpoint&domain=cla-website-dev.imgix.net&fit=crop&fp-x=0.5&fp-y=0.5&h=12&ixlib=php-3.3.1&w=30
And this image does not display, because it is missing the Subpath from the path.
As a test, If I manually add
/images-hero/
to the above URL after the source domain, I can see the transformed Asset successfully generated by IMGix.Is this a bug with ImageOptimize or a configuration issue on my end?
Thanks in advance for any help you can give!
EDIT:
I can't seem to find this actually documented anywhere, but in Craft 5, you can have a 1:many Filesystem > Volume setup, so I think this is actually a bug! The key field here is Subpath in the Volume settings:
Additional context
Craft CMS 5.0.5
ImageOptimize 5.0.0
The text was updated successfully, but these errors were encountered: