|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20785 ImageCreateTrueColor, ImageCreateFromJPEG +pdflib fails - cannot create images
Submitted: 2002-12-03 05:26 UTC Modified: 2002-12-03 13:26 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: tb at scarptor dot net Assigned:
Status: Closed Package: PDF related
PHP Version: 4.2.3, 4.4.0-dev OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
48 - 12 = ?
Subscribe to this entry?

 [2002-12-03 05:26 UTC] tb at scarptor dot net
As reported at
ImageCreateTrueColor and others does not work correctly when using
pdflib > 4.0.x and PHP > 4.2.x and reading the image from memory (reading from
file seems to work though).

Excerpt from forum and configuration information below.

$im = ImageCreate(100, 100);
$pim = pdf_open_memory_image($pdf, $im);

$im = ImageCreateTrueColor(100, 100);
$pim = pdf_open_memory_image($pdf, $im);

$im = ImageCreateFromJPEG("file.jpg");
$pim = pdf_open_memory_image($pdf, $im);

PHP 4.2.3
GD 2.0.8
PDFLib 4.0.3 (compiled with default options)

Configure Options:

./configure \
                      --with-config-file-path=/etc \
                      --with-apxs=/usr/local/apache/bin/apxs \
                      --enable-versioning \
                      --enable-inline-optimization \
                      --enable-magic-quotes \
                      --enable-track-vars \
                      --with-xml --with-dom --with-xmlrpc \
                      --with-mysql=/usr \
                      --enable-sockets \
                      --with-ldap \
                      --with-imap=/usr/local --with-imap-ssl=/usr/local \
                      --with-mm \
                      --enable-memory-limit \
                      --enable-bcmath \
                      --enable-sigchild \
                      --with-zlib=/usr \
                      --with-curl=/usr/local \
                      --with-dom=/usr/include/libxml2/libxml \
                      --enable-exif \
                      --enable-ftp \
                      --with-gettext=/usr/share \
                      --with-gd \
                      --with-ttf \
                      --with-freetype-dir=/usr/local/include/freetype2/freetype \
                      --enable-gd-imgstrttf \
                      --with-png-dir=/usr \
                      --with-jpeg-dir=/usr \
                      --with-tiff-lib=/usr \
                      --with-mcal=../libmcal \
                      --with-openssl \
                      --with-mcrypt --with-mhash \
                      --with-pspell \
                      --with-ming \


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-03 05:31 UTC]
Please try using this CVS snapshot:
For Windows:
 [2002-12-03 05:32 UTC] tb at scarptor dot net
Clarification: 256 color images can be created with
ImageCreate, however ImageCreateTrueColor and possibly 
other calls intended to create images with more than 256 colors fails.
 [2002-12-03 05:51 UTC] tb at scarptor dot net
Tried with the latest snapshot, 200212031030 and
unfortunately it didn't work either.
 [2002-12-03 13:26 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 15:01:30 2024 UTC