|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-21 13:15 UTC] stanleysufficool at adelphia dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 00:00:02 2025 UTC |
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.