php - Why are some images not rendering -
my program uploads images of various sizes blob field of mysql database using php. able upload different sizes 1mb , above. problem when display them, able display images less 10kb. larger images, error displayed ..... cannot displayed because contains errors (in firefox), , in chrome, shows image placeholder. have tried many tricks, , have googled everywhere. edited both php.ini , my.ini. program intranet application, , there less 50 users @ time. script used display images:
if remove header ('content-type: '.$resource_type), dumps binary code on screen. have increase mysql packet size 100mb, , problem persists.
$d_id= $_get['k'];$query="";$query_handle=0;$row="";$no_of_rows=0; $query="select * tdoc "; $query.=" ucase(trim(fsha_doc_key))='".strtoupper(trim($d_id))."' "; $query_handle=mysql_query($query,$conn_handle); if(!$query_handle) {$error_flag=1;echo '<br />unable execute query extract resource code:fref';} if($query_handle) $no_of_rows=mysql_num_rows($query_handle); if(($query_handle)&&($no_of_rows<=0)) {$error_flag=1;echo '<br />the exact resource: '.strip_tags($d_id).' not found ';} if(($query_handle)&&($no_of_rows>0)){ $row=mysql_fetch_assoc($query_handle); $resource_type=trim($row['ftype']); $resource_size=$row['fsize']; $resource_h=$row['fheight']; $resource_w=$row['fwidth']; $d_resource=$row['fdoc']; header('content-type: '.$resource_type); header( 'expires: sat, 26 jul 1997 05:00:00 gmt' ); header( 'last-modified: ' . gmdate( 'd, d m y h:i:s' ) . ' gmt' ); header( 'cache-control: no-store, no-cache, must-revalidate' ); header( 'cache-control: post-check=0, pre-check=0', false ); header( 'pragma: no-cache' ); header('content-length: '.filesize($d_resource)); header('content-height: '.$resource_h); header('content-width: '.$resource_w); echo stripslashes(base64_decode($d_resource)); }
i have read exclusively posts concerning error here, none address specific issue, because mine displaying small size images not images , above 10kb. 10kb far cry projected average image size uploaded later. please help.
if $d_resource
binary image data
you should used imagejpeg or imagegif or other series functions, rather echo
Comments
Post a Comment