From 0b3036454c9b73d650fd187de457d1377bbc1b55 Mon Sep 17 00:00:00 2001 From: Martin Packman Date: Mon, 17 Sep 2018 16:30:42 +0100 Subject: [PATCH] Give correct extrema for I;16 format images Currently gives None for a 16 bit greyscale image rather than the true min and max values in the 0-65536 range. The internal ImagingGetProjection function already supports I;16 but the _getextrema needs to know to unpack the result. --- Tests/images/16_bit_noise.tif | Bin 0 -> 2446 bytes Tests/test_image_getextrema.py | 8 ++++++++ src/_imaging.c | 5 +++++ 3 files changed, 13 insertions(+) create mode 100644 Tests/images/16_bit_noise.tif diff --git a/Tests/images/16_bit_noise.tif b/Tests/images/16_bit_noise.tif new file mode 100644 index 0000000000000000000000000000000000000000..19180638efa88ebf827c78a7ed5e4a112815e10b GIT binary patch literal 2446 zcmbuB+f$oW6vbBx#q`D7c&WD;A07V>ANrs#>ObM5R_%-(iy)8?E+K^w8VDrNgmMe_ zON0Okgm5cRZYDsTLTP0Lt+%nxIIX|)nTNc~H|L!FeK~vYwbx$f43{pwE4y9#NxM4M zymlD7npRB1n$(QO6xB`afO-^GttQl=TMDWL+bfT5s9cr0q7!9xo99GnZD~X6ct^FW zaXhxwrCyCN2Z-Tku9u4uAVM8asjBp|lKMl1wl)2TZvqqtnj%gN1TDOGYn04AYSVRm zTU3MPQZ?CY_9_9dV5k?c0SHWLBqe5l8IaNaKTlf#*dqm}1 zR6eIQsyG3CFHe(J@D8yf2m;f^Qqb4JLYcm0zN?2kXLSD%&mAJf!8=KuSv&?o+eZf? z)>|!{do1=H9HQcVFLeEsy?NH+xU+1K4fVqK@}mm9H*DU9B_rTB9PLrQl{fZh^c8{`+9wWAR@F{!{SB@Y@8- z67vMvmw3jB(+lzlR*e3)(#w9L7}dJrun`rxIR88Jt;n{mbG8N4lxFX=brQm`)XTTPU5{X^An*^;O?iw0A$l?3?$nZ`IfD_}LZNQm!VdNBlsQn0t- z`xVxg;Qbx;vSePM6Ek!>3r}(Oc4D`(GlPmE#Oq>DtHnYMb2aQ&aQ_t9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