php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79052 Incorrect BZERO in FITS header
Submitted: 2020-01-01 03:29 UTC Modified: 2021-08-02 14:01 UTC
From: gajowy at agzeta dot pl Assigned: cmb (profile)
Status: Not a bug Package: imagick (PECL)
PHP Version: 7.3.13 OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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-01-01 03:29 UTC] gajowy at agzeta dot pl
Description:
------------
When creating 16-bit FITS file, a value of BZERO header is set literaly to "3.276750E+04", what is 32767.5
In this case it is impossible to store correct pixel value in 16-bits, as it's calculated as follows:
true_pixel_value = array_value * BSCALE + BZERO


Test script:
---------------
$im= new Imagick();
$im->newImage(1,1,'none','FITS');
$im->setImageDepth(16);
$im->writeImage('file.fit');
$im->destroy();


Expected result:
----------------
Value 32768 is used instead for BZERO.

Actual result:
--------------
BZERO is 3.276750E+04

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-02 14:01 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-08-02 14:01 UTC] cmb@php.net
This doesn't look like an issue with the imagick extension, but
rather an issue of ImageMagick.  Consider to report that
upstream[1].

[1] <https://github.com/ImageMagick/ImageMagick/issues>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 09 17:01:28 2024 UTC