php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6141 GetImageSize cannot recover size of PNGs
Submitted: 2000-08-14 04:48 UTC Modified: 2000-08-17 03:12 UTC
From: b dot tenhumberg at web dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1pl2 OS: Linux 2.2.16
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: b dot tenhumberg at web dot de
New email:
PHP Version: OS:

 

 [2000-08-14 04:48 UTC] b dot tenhumberg at web dot de
GetImageSize calculates the size of GIFs and JPGs correctly, but PNGs aren't identified... Due to that no size can be calculated.
GDLib-Version is 1.7.3

I compiled it static with following parameters:
--with-apache=$APACHEPATH \
           --with-mysql \
           --with-mm \
           --enable-track-vars

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-15 06:47 UTC] stas@php.net
Failed to reproduce this. Could you provide a link to PNG image that doesn't work?
 [2000-08-16 02:25 UTC] b dot tenhumberg at web dot de
Maybe it's a installation- or compile-problem.
The problem occurs any time on any PNG-graphic produced with 'xv'.

PHP-Info says:
GD Support              enabled
GD Version              1.6.2 or higher
FreeType Support     enabled
FreeType Linkage     with TTF library
PNG Support            enabled

Following problem goes along with it: After some hours any child-process of apache is terminated with signal 11...
 [2000-08-16 09:46 UTC] b dot tenhumberg at web dot de
The problem appears after editing the image with 'convert' from Imagemagick.

Sorry!!! Forget this!

BTW: Great stuff!

 [2000-08-16 10:10 UTC] b dot tenhumberg at web dot de
It seems that PHP needs the 'png' - suffix after 'convert' has modified it.
Maybe it destroys the magic-number of the png-file, so that PHP  looks at the suffix...

Is that true?
 [2000-08-16 10:24 UTC] stas@php.net
It expects PNG signature there - 
(char) 0x89, (char) 0x50, (char) 0x4e,
(char) 0x47, (char) 0x0d, (char) 0x0a,
(char) 0x1a, (char) 0x0a

What your files have?
 [2000-08-17 03:12 UTC] b dot tenhumberg at web dot de
OK. Everything's ok with GetImageSize... I was too fast. Sorry.

Now I use these steps of rescaling a file with variable type:
1. Recovering the filetype (jpg, png...)
2. Rescaling: The second filename MUST have the right suffix!
ex: convert -scale 200x200 file.png newfile.png

I've used 'newfile.tmp', so convert made an unuseful file...

Thank You!

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 12:01:31 2025 UTC