473,366 Members | 1,156 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,366 software developers and data experts.

GD Error on displaying png image

When trying to load a png image in GD, I get the error (Mozilla Firefox)
"cannot display image, because it contains errors"; IE just shows an empty
'image-error' box.
When loading a large enough image, it does build up the image
gradually until it's almost finished, but then the partly visible image
is replaced by the error message/error box as described above.
It seems like indexed <256cols pngs are not subject to this problem. I've
read that earlier versions of GD were limited to handling indexed pngs
only, but recent GD versions (>=2.0) should not.

My configuration:
GNU/Debian Linux 3.0, Apache 1.3.31, PHP 4.3.4, GD 2.0 'or higher'
(bundled with PHP), libpng12-0 1.2.5.0-7,
Also tested on GNU/Slackware Linux 9.0 with Apache 2.0.49, PHP 4.3.6,
GD 2.0.22, with similar results.

The testcode I use:
<?php
$photo = "image.png";
$im = @ImageCreateFromPng ($photo);
header ("Content-type: image/png");
ImagePng ($im);
?>

Anyone got a clue? Thanks in advance.
Wim


Jul 17 '05 #1
2 3397
On Sun, 29 Aug 2004 16:52:40 +0200, "Xiao Tencas" <xi*********@gmx.net> wrote:
When trying to load a png image in GD, I get the error (Mozilla Firefox)
"cannot display image, because it contains errors"; IE just shows an empty
'image-error' box.
When loading a large enough image, it does build up the image
gradually until it's almost finished, but then the partly visible image
is replaced by the error message/error box as described above.


A wild guess; how long does the image take to download? Is it exceeding the
setting of max_execution_time? This would dump an error message in the image
data and so could cause this symptom.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
On Sun, 29 Aug 2004 16:52:40 +0200, Xiao Tencas wrote:
The testcode I use:
<?php
$photo = "image.png";
$im = @ImageCreateFromPng ($photo);
header ("Content-type: image/png");
ImagePng ($im);
?>


No clue. But to debug GD images, you can change the header to
"Content-type: text/plain" temporarily. This will dump the contents to the
screen as plain text, including error messages!

--
Jeffrey D. Silverman | je**********@jhu.edu **
Website | http://www.newtnotes.com

(** Drop "pants" to reply by email)

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Carolyn Gill | last post by:
It was working fine on the test server. loaded it onto iis6 server after installing php and got everything working (after redirecting it to the correct directory) except for 1 annoying error that I...
7
by: Paul | last post by:
I thought this is more of an IE issue but i've had no joy on that group perhaps somebody here will have a clue. If i click a link to a web page embedded in Excel (97 OR 2000) i get the standard...
3
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or...
3
by: T. Davis | last post by:
In C#, I am able to successfully stream a TIFF image that comes from a BLOB field in a database, save it to file, then convert the pages within TIFF file into jpegs (using GDI+) and display on the...
25
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from...
3
by: xievvv | last post by:
Hi, I am getting an image from pc location and when displaying it on a web page using filestream, it give following error. A generic error occurred in GDI+. ...
4
by: pmz | last post by:
Dear Group, I'm not sure what is going one with my software, but something really strange. I'm storing in BLOB in MySQL data of an image, which I display like: header("Content-Type:...
4
by: redpears007 | last post by:
Hi Again, Throwing this one out to you again as i am not getting anywhere and can find little to no information out there. I am currently displaying images (Jpegs) in access via the routine...
7
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference....
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.