JuliaImages / ImageView.jl

Interactive display of images and movies
MIT License
135 stars 34 forks source link

Minimizing window created with ImageView imshow crashes Julia #301

Closed caesquerre closed 5 months ago

caesquerre commented 7 months ago

If I minimize any image after using the brightness/contrast GUI (right-click) and maximizing Julia crashes. I am using Visual Studio Code 1.85.1 on Windows10

Julia Version 1.10.0 Commit 3120989f39 (2023-12-25 18:01 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, skylake) Threads: 11 on 8 virtual cores
Environment: JULIA_EDITOR = code JULIA_NUM_THREADS =

using ImageView, TestImages
img = testimage("mandrill")
imshow(img)

Produce

Dict{String, Any} with 4 entries:
  "gui"         => Dict{String, Any}("window"=>GtkWindowLeaf(accessible-role=GTK_ACCESSIBLE_ROLE_WINDOW, name="", parent, root, width-request=-1, height-request=-1, visible=true, sensitive=true, can-…  "roi"         => Dict{String, Any}("redraw"=>ObserverFunction[ObserverFunction defined at C:\Users\carlos.esquerre\.julia\packages\Observables\YdEbO\src\Observables.jl:419 operating on Observable(R…  "annotations" => Observable(Dict{UInt64, Any}())
  "clim"        => Observable(CLim{RGB{Float64}}(RGB{Float64}(0.0,0.0,0.0), RGB{Float64}(1.0,1.0,1.0)))

After using the brightness/contrast GUI, maximize and then minimize the window

julia>
(process:15364): Gtk-WARNING **: 15:39:56.987: gtk_widget_size_allocate(): attempt to allocate GtkWindowHandle windowhandle 000001B2D3D76310 with width -7 and height 28

(process:15364): Gtk-WARNING **: 15:39:56.987: gtk_widget_size_allocate(): attempt to allocate GtkImage image 000001B2D54C2700 with width 26 and height -2

(process:15364): Gtk-WARNING **: 15:39:56.988: gtk_widget_size_allocate(): attempt to allocate GtkImage image 000001B2D331E9F0 with width 26 and height -2

(process:15364): Gtk-WARNING **: 15:39:56.988: gtk_widget_size_allocate(): attempt to allocate GtkImage image 000001B2D5D45E70 with width 26 and height -2

(process:15364): Gtk-WARNING **: 15:39:56.988: gtk_widget_size_allocate(): attempt to allocate GtkBox box 000001B2D5C0B7D0 with width 1 and height -36
jwahlstrand commented 6 months ago

I haven't been able to reproduce this so far. How are you running ImageView through vscode, within the terminal? I assumed that had something to do with the issue, but I just spent a bit of time playing around in vscode (which I don't use much) and ImageView works fine for me.

caesquerre commented 5 months ago

Many thanks jwahlstrand for your reply, I had the issue using both the REPL and VS Code in 2 different laptops using Julia 1.10.0 and 1.9.4. The issue was resolved for me upgrading the environment using '] up' in both Julia 1.10.0 and 1.10.1 which I did after reading your comment. ImageView with the contrast tool are very useful to explore images.