php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57430 TIFF Displays as Vertical Lines
Submitted: 2006-12-14 17:59 UTC Modified: 2006-12-21 13:15 UTC
From: stanleysufficool at adelphia dot net Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.0.5 OS: Gentoo Linux 2.6.12
Private report: No CVE-ID: None
 [2006-12-14 17:59 UTC] stanleysufficool at adelphia dot net
Description:
------------
Converting a database blob to a PNG image sometimes produces an image of random vertical lines. When the image is regenerated a different pattern is produced.

Reproduce code:
---------------
<?php
	// reference this file as <img src="signature.php?image_id=##">
	if ( isset($_GET['image_id']) && $_GET['image_id'] != '' ) {
		if (isset($_SESSION['user'])) mssql_connect('server',$_SESSION['user'], $_SESSION['pass']);
		$result = mssql_query("SELECT image FROM image WHERE image_id = {$_GET['image_id']}");
		if (mssql_num_rows( $result ) == 0 ) die("NO ATTACHED IMAGE");
		$row = mssql_fetch_row ($result);
		if ($row[0] == '') die("NULL IMAGE");
		$handle = imagick_blob2image( $row[0] ) or die("Invalid image BLOB");
		imagick_convert( $handle, "PNG" ) or die("Conversion to PNG Failed");
		header( "Content-type: " . imagick_getmimetype( $handle ) ) ;
		print imagick_image2blob( $handle );
	}
?>

Expected result:
----------------
The image stored in the database.

Actual result:
--------------
Random vertical lines varying with each attempt.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-21 13:15 UTC] stanleysufficool at adelphia dot net
This was due to php.ini max text size of 4096, expanded to 8MB, problem solved.

Should report invalid image format or unexpected end of scanline.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 21:01:29 2024 UTC