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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC