Open markusmoenig opened 5 months ago
I want to take a stab in implementing it and I'm not sure where/if it should go within the Asset
system. It's used for both images and commit avatars, and images can be used with files, uris or data (not relevant since it skips the asset system all together), and out of all of them only images based on files make sense to watch, so it needs to be optional, watching outside the asset system and calling remove_cached_asset
than use_cached_asset
seems like a bad idea, and skipping the asset system means losing out/duplicating caching. Also I'm a bit confused as to why crates/gpui/src/elements/img.rs:371
does a blocking read for files when the entire system is build to be async, is there a reason for that?
Just ran into this-really surprised this isn't fixed yet and I lost a lot of time today thinking Figma was broken...
I also can't understand why this is not fixed. For those of use working with images it is a deal breaker. Only explanation I have is that they want to move all this into extensions but the extension engine is not yet far enough along to support it.
Here's an easy repro of it / video for a maintainer:
from PIL import Image
import random
# save an image from a random color to ./img.png
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
img = Image.new('RGB', (512, 512), color = (r, g, b))
img.save('./img.png')
https://github.com/zed-industries/zed/assets/46694203/841912d1-f6b4-4087-9718-9841b9e3688e
This is still broken in Zed Nightly 0.151.0.
Steps to reproduce:
mario.png
in Zed.cp luigi.png mario.png
Notice Zed still shows the Mario and not the Luigi! Zed should listen for image changes with inotify just like we do for other file buffers.
Shame such core thing is not fixed yet. I spent 5 hours of debugging just to find out there is something like this
Check for existing issues
Describe the bug / provide steps to reproduce it
The PNG image preview inside Zed does not update when the image changes.
Environment
Zed: v0.133.7 (Zed) OS: macOS 14.4.1 Memory: 24 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.No response