http://qs1969.pair.com?node_id=11129632


in reply to Re^2: Tk screen and monitor size in mm, DPI and scaling -- Parse::EDID
in thread Tk screen and monitor size in mm, DPI and scaling

I think parse_edid expects raw binary, and

my $raw_edid = pack 'H*', $registry;

will work. There's also check_parsed_edid to alert you, even when (very) suspicious results failed to do so :).

Looking at output, fractional dimensions, in mm, indicate something more involved than simply reading size in whole cm (bytes 21-22), I didn't investigate more closely. Further, I didn't investigate neither (sorry), if, after MainWindow-> scaling(X), anywhere where number for size (meaning 'pixels') is to be used, string such as "N.nm" (N.n mm) would result in identical rendering on screen (let's assume no rounding). That's the whole point of it all, to forget about 'pixels', if I'm reading what you say "re-calculate the size in mm" correctly. I agree, I'd probably won't follow this route, neither (not until all displays are 250 dpi or more).

Replies are listed 'Best First'.
Re^4: Tk screen and monitor size in mm, DPI and scaling -- Parse::EDID -- solution
by Discipulus (Canon) on Mar 15, 2021 at 07:45 UTC
    Hello vr,

    > There's also check_parsed_edid to alert you, even when (very) suspicious results failed to do so :)

    ah ah ah.. so I was looking shadows on the wall of the cavern supposing them to be real things :)

    Adding print check_parsed_edid( $edid ); only prints for my bad edid_version but I already noticed in my previous output year => 2039 and I had to suspect something wrong.

    Anyway with you packed string (thanks again!) it seems I have meaningful results. I add it here for the posterity (hiding the serial number, just in case..), when we'll have 250 dpi monitors.

    Notably now I read:

    'max_size_horizontal' => '47.7', 'max_size_vertical' => '26.8',

    and these are the physical measures of my monitor!

    Even if I will remove mm calculation from my code, what is better than learn yet another unuseful thing? :)

    Thanks for the support

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.