php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79473 Invalid statistics for 32-bit FITS
Submitted: 2020-04-14 10:31 UTC Modified: -
From: gajowy at agzeta dot pl Assigned:
Status: Open Package: imagick (PECL)
PHP Version: 7.3.16 OS: Windows 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gajowy at agzeta dot pl
New email:
PHP Version: OS:

 

 [2020-04-14 10:31 UTC] gajowy at agzeta dot pl
Description:
------------
When using getImageChannelStatistics, getImageChannelRange and getImageChannelMean for 32-bit FITS image file, results are invalid.

Test script:
---------------
$channel=imagick::CHANNEL_GRAY;

$img = new Imagick();

$img->readImage('TestFile32.fit');

printf("getImageChannelRange = %s\n",print_r($img->getImageChannelRange($channel),TRUE));

printf("getImageChannelMean = %s\n",print_r($img->getImageChannelMean($channel),TRUE));

$sta=$img->getImageChannelStatistics();

printf("getImageChannelStatisctics = %s\n",print_r($sta[$channel],TRUE));

print_r($sta);

$img->destroy();

Expected result:
----------------
getImageChannelRange = Array
(
    [minima] => 0
    [maxima] => 4294967295
)

getImageChannelMean = Array
(
    [mean] => 93651004.9791211685
    [standardDeviation] => 40492390.85557395135
)

getImageChannelStatisctics = Array
(
    [mean] => 93651004.9791211685
    [minima] => 0
    [maxima] => 4294967295
    [standardDeviation] => 40492390.85557395135
    [depth] => 32
)

Actual result:
--------------
getImageChannelRange = Array
(
    [minima] => -9.3130836376076E-10
    [maxima] => 65535
)

getImageChannelMean = Array
(
    [mean] => 1428.9791211685
    [standardDeviation] => 617.85557395135
)

getImageChannelStatisctics = Array
(
    [mean] => 0
    [minima] => 1.7976931348623E+308
    [maxima] => -1.7976931348623E+308
    [standardDeviation] => -0
    [depth] => 1
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Dec 05 06:01:23 2020 UTC