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: 2021-08-15 04:22 UTC
From: gajowy at agzeta dot pl Assigned: cmb (profile)
Status: No Feedback Package: imagick (PECL)
PHP Version: 7.3.16 OS: Windows 10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-02 14:02 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-02 14:02 UTC] cmb@php.net
Please make TestFile32.fit publicly available for download.
 [2021-08-15 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 22:03:39 2021 UTC