Skip to content

Improper Normed handling in the contrast GUI #310

@kimikage

Description

@kimikage

This is a little related to issue #308 and PR #309. The contrast GUI causes errors with the images using Normed, such as N0f8.

julia> using ImageView

julia> using ImageView.FixedPointNumbers

julia> VERSION
v"1.10.4"

julia> pkgversion(ImageView)
v"0.12.4"

julia> n0f8s = N0f8[0.2 0.8];

julia> imshow(n0f8s); # and then slide "slider_max" to the left

┌ Warning: Executing #14:
└ @ Gtk4.GLib C:\Users\username\.julia\packages\Gtk4\pLBGK\src\GLib\signals.jl:122
ERROR: 0.2N0f8 is not within the span of 0.20000000298023224:0.002362204759609042:0.800000011920929
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] setindex!(s::GtkObservables.Slider{Float32}, ::Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, N0f8})
    @ GtkObservables C:\Users\username\.julia\packages\GtkObservables\gSI6s\src\widgets.jl:173
  [3] (::ImageView.var"#130#133"{Observables.Observable{CLim{N0f8}}, Dict{String, Any}, N0f8, DataType})(cmin::Float32, cmax::Float32)
    @ ImageView C:\Users\username\.julia\packages\ImageView\QLmQc\src\contrast_gui.jl:103
  [4] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
    @ Base .\essentials.jl:892
  [5] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base .\essentials.jl:889
  [6] (::Observables.MapCallback)(value::Any)
    @ Observables C:\Users\username\.julia\packages\Observables\YdEbO\src\Observables.jl:436
  [7] #invokelatest#2
    @ .\essentials.jl:892 [inlined]
  [8] invokelatest
    @ .\essentials.jl:889 [inlined]
  [9] notify
    @ C:\Users\username\.julia\packages\Observables\YdEbO\src\Observables.jl:206 [inlined]
 [10] setindex!(observable::Observables.Observable, val::Any)
    @ Observables C:\Users\username\.julia\packages\Observables\YdEbO\src\Observables.jl:123
 [11] (::GtkObservables.var"#14#15"{Observables.Observable{Float32}})(w::Gtk4.GtkScaleLeaf)
    @ GtkObservables C:\Users\username\.julia\packages\GtkObservables\gSI6s\src\widgets.jl:155
 [12] (::Gtk4.GLib.var"#134#136"{Ptr{Gtk4.GLib.GValue}, UInt32, Ptr{Gtk4.GLib.GValue}, Vector{Any}, GtkObservables.var"#14#15"{Observables.Observable{Float32}}})()
    @ Gtk4.GLib C:\Users\username\.julia\packages\Gtk4\pLBGK\src\GLib\signals.jl:63
 [13] g_siginterruptible(f::Gtk4.GLib.var"#134#136"{Ptr{Gtk4.GLib.GValue}, UInt32, Ptr{Gtk4.GLib.GValue}, Vector{Any}, GtkObservables.var"#14#15"{Observables.Observable{Float32}}}, cb::Any)
    @ Gtk4.GLib C:\Users\username\.julia\packages\Gtk4\pLBGK\src\GLib\signals.jl:244
 [14] GClosureMarshal(closuref::Ptr{Nothing}, return_value::Ptr{Gtk4.GLib.GValue}, n_param_values::UInt32, param_values::Ptr{Gtk4.GLib.GValue}, invocation_hint::Ptr{Nothing}, marshal_data::Ptr{Nothing})
    @ Gtk4.GLib C:\Users\username\.julia\packages\Gtk4\pLBGK\src\GLib\signals.jl:57
 [15] (::Gtk4.GLib.var"#233#234")()
    @ Gtk4.GLib C:\Users\username\.julia\packages\Gtk4\pLBGK\src\GLib\loop.jl:83
 [16] g_sigatom(f::Any)
    @ Gtk4.GLib C:\Users\username\.julia\packages\Gtk4\pLBGK\src\GLib\signals.jl:211
 [17] glib_main()
    @ Gtk4.GLib C:\Users\username\.julia\packages\Gtk4\pLBGK\src\GLib\loop.jl:80

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions