-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
World age error when displaying PNG images #609
Comments
I think the problem is that FileIO will load Images, but we will not hit top level scope until the call to I think we can either add some diff --git a/src/inline.jl b/src/inline.jl
index 2e82131..7cc1ee3 100644
--- a/src/inline.jl
+++ b/src/inline.jl
@@ -21,14 +21,14 @@ function limitstringmime(mime::MIME, x)
if israwtext(mime, x)
return String(x)
else
- show(IOContext(buf, :limit=>true), mime, x)
+ Base.invokelatest(show, IOContext(buf, :limit=>true), mime, x)
end
else
b64 = Base64EncodePipe(buf)
if isa(x, Vector{UInt8})
write(b64, x) # x assumed to be raw binary data
else
- show(IOContext(b64, :limit=>true), mime, x)
+ Base.invokelatest(show, IOContext(b64, :limit=>true), mime, x)
end
close(b64)
end or document this somehow. |
Interesting. It would be nice to have it fixed in IJulia, of course! Although I'm happy to insert some (similar?) fix into |
You could try change e.g: https://github.com/JuliaGraphics/Luxor.jl/blob/2fec4728ef3750ba203bda0d2eb0afff4626c5a3/src/Luxor.jl#L338 to Base.invokelatest(display, "image/png", load(currentdrawing.filename)) and see if it works. |
Seems similar to JuliaIO/FileIO.jl#142 ... it seems like there is a fundamental difficulty (not IJulia-specific) with how FileIO loads modules on-demand in the context of a single |
@KristofferC That (Luxor) fix seems to work fine! It's not time critical, so I can't see any drawbacks. Thanks! I'll leave this issue open. |
It's not an IJulia-specific issue; the same thing would presumably happen in the REPL if you have a display backend capable of showing |
In a new Jupyter Notebook, I do this:
using FileIO; display("image/png", FileIO.load("/tmp/image.png"))
and get this error:
But then when I evaluate the cell again, it works correctly; so it only generates this error the first time it runs in a notebook.
I don't really understand 'world age errors'... :(
Julia v0.6, IJulia.jl 1.6.2
The text was updated successfully, but these errors were encountered: