php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8626 Memory fault when having a image in the PDF Document
Submitted: 2001-01-10 03:22 UTC Modified: 2001-01-10 07:30 UTC
From: peter dot caflisch at bit dot admin dot ch Assigned:
Status: Closed Package: PDF related
PHP Version: 4.0.4 OS: Compaq True64 UNIX
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:
MUST BE VALID
Solve the problem:
22 - 19 = ?
Subscribe to this entry?

 
 [2001-01-10 03:22 UTC] peter dot caflisch at bit dot admin dot ch
Memory fault when having a image in the PDF Document 
Only with php-4.0.4 with php-4.0.3pl1 it was OK.
The same behaviour when used with a .png image. 
Also the same behaviour when using pdflib-3.0 or pdflib-3.0.3.

Testscript:
<?
$tempfile = tempnam ("/tmp", "pdf");
$fp = fopen("$tempfile", "w");

$pdf = pdf_open($fp);
pdf_set_info($pdf, "Author", "Peter Caflisch");
pdf_set_info($pdf, "Title", "Test");
pdf_set_info($pdf, "Creator", "Peter Caflisch");
pdf_set_info($pdf, "Subject", "erstellt am: $datum");

pdf_begin_page($pdf, 595, 842);
pdf_add_outline($pdf, "Seite ".$seite. "  A.." );

$im = pdf_open_image_file($pdf, "gif", "efdlogo.gif");
pdf_place_image($pdf, $im, 18, 790, 0.8);
pdf_close_image($pdf, $im);
pdf_end_page($pdf);
pdf_end_page($pdf);
pdf_close($pdf);
fclose($fp);

$fp1 = fopen("$tempfile", "r");
   header("Content-type: application/pdf");
fpassthru($fp1);
unlink ($tempfile);
?>


RESULTS
-----------
with php-4.0.4:
>php testpdf.php
>Memory fault

with php-4.0.3pl1:
>php testpdf.php
>
Is the same as a apache module.



CONFIG:
tar -xvf ../number4.tar
CC=gcc ./configure  --with-mysql=/appl/mysql --enable-bcmath --with-imap=/appl/imap \
--without-iodbc --without-udbc --with-openlink=/appl --with-pdflib --without-yaz \
 --with-gd --with-zlib-dir=/appl/zlib --with-ldap --with-jpeg-dir=/appl/jpeg-6b \
 --enable-ftp --enable-track-vars
make
make install

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-10 07:30 UTC] sniper@php.net
This is fixed in CVS. Please try the latest snapshot from http://snaps.php.net/
and if it doesn't work either,  reopen this bug report.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC