Skip to content
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

In specific circumstances, thumbnail previews are not showing when using SharpImageTransform #5

Open
adrienne opened this issue Dec 22, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@adrienne
Copy link

Describe the bug

When we first upload a new image into a Matrix field, and before we have Saved the entry, we get our "not found" placeholder. This definitely does not happen with ImageOptimize's normal CraftImageTransform class.

This seems to be specific to:
a) Matrix blocks
b) where the Assets field uses a Twig expression including {{ owner.[something] }} to restrict the folder

I tested, and Asset fields inside Matrix blocks in general work fine, as do non-Matrix Asset fields that use a Twig expression.

I know there were some vaguely recent changes to thumbnailing behavior by Craft itself (I had to report a bug to Craft about their thumbnail handling about a month ago), so I wonder if something isn't hooking together correctly?

To reproduce

Steps to reproduce the behaviour:

  1. Create a Matrix field
  2. Create a block type
  3. Create an asset field in your block
  4. Set the Asset field's Default Asset Location to {{owner.site.handle}}
  5. Make sure "Allow uploading directly to the field" is checked on the Asset field
  6. Add your Matrix field to a section, then try uploading a new photo directly using "Upload a File"

Expected behaviour

The actual image thumbnail should show as soon as the image is uploaded, instead of showing our "not found" placeholder.

Screenshots

image

Versions

  • Plugin version: ImageOptimize 1.6.38
  • Craft version: Craft Pro 3.7.26
@adrienne adrienne added the bug Something isn't working label Dec 22, 2021
@adrienne
Copy link
Author

adrienne commented Jan 2, 2022

@khalwat just making sure you see this after the holidays! 😃

@khalwat
Copy link
Collaborator

khalwat commented Jan 2, 2022

I saw it -- and it's on the list to be looked into after the break.

I do wonder if this has anything to do with IO, or if it also happens if you're not using IO at all?

It seems pretty specific. Also it shouldn't matter what the transform method is (Sharp or not) though that'd be another datapoint.

@adrienne
Copy link
Author

adrienne commented Jan 2, 2022

It definitely does not happen with IO disabled, nor does it happen with the default transform method. (I checked both of those things.) It only happens with the Sharp transform class.

@khalwat
Copy link
Collaborator

khalwat commented Jan 2, 2022

Excellent information, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants