从数据库导入图像并将其输出到图库中时,图像会变得模糊吗?

时间:2019-03-22 12:10:39

标签: html css image

Blurry Image Original image

我在php中有一个简单的图像上传功能。它拍摄图像并将其作为Blob上传到数据库。当我将图像调入图库时,图像变得模糊。有没有解决的办法,我听说有人在使用GD等。下面是我的代码用于上传和调用。

gallery.php

@override 
Widget build(BuildContext context) { 
    return Scaffold(
      appBar: AppBar(title: Text("Bills Receivable"),),
      body:SingleChildScrollView( 
        scrollDirection: Axis.horizontal, 
        child:
           DataTable(
          columns: <DataColumn>[
            DataColumn(label:Text("BNm",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BDt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BPrty",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BdueDt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("Dys",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BAmt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BPAmt",style: TextStyle(fontWeight: FontWeight.bold),)),
            DataColumn(label:Text("BBAmt",style: TextStyle(fontWeight: FontWeight.bold),))
          ], rows:  widget.rdata.bRecDtl.map((e)=>
            DataRow(
              cells:<DataCell>[
                DataCell(Text(e.bNm.toString())),
                DataCell(Text(e.bDt.toString())),
                DataCell(Text(e.bPrty.toString())),
                DataCell(Text(e.bdueDt.toString())),
                DataCell(Text(e.dys.toString())), 
                DataCell(Text(e.bAmt.toString())),
                DataCell(Text(e.bPAmt.toString())),
                DataCell(Text(e.bBAmt.toString())),
          ])).toList()
        ),
      ),
    );
  }

uploadFile.php

<div data-u="slides" style="cursor:default;position:relative;top:0px;left:0px;width:1300px;height:500px;overflow:hidden;">
              <?php 
              $result = mysqli_query($connection, "SELECT * FROM tbl_images"); 

              while($row = mysqli_fetch_array($result))
  {
            ?>
            <div>
                <?php echo'<img width="100%" height:"100%" class="img-fluid" src="data:image/jpg;base64,' . base64_encode($row['name']) . '"  />' ?>

            </div>
  <?php } ?>

1 个答案:

答案 0 :(得分:0)

尝试将if ($paths -like "*.sql") { if ($paths.Contains("\")) { $last = $paths.Split("\")[-1] #get the last part of the path $result = "03-22-2019" #get this date from some where else if ($result) { #check if pattern string exists in that file. $SEL = Select-String -Path <path location> -Pattern $result if ($SEL -ne $null) { Write-Host "`n $last Contains Matching date " } else { Write-Host "`n $last Does not Contains date" } } else { Write-Host "`ndate field is blank" } } else { $result = "03-22-2019" #get this date from some where else if ($result) { #check if pattern string exists in that file. $SEL = Select-String -Path <path location> -Pattern $result if ($SEL -ne $null) { Write-Host "`n $last Contains Matching date " } else { Write-Host "`n $last Does not Contains date" } } else { Write-Host "`ndate field is blank" } } } elseIf ($paths -like "*.txt") { if ($paths.Contains("\")) { $last = $paths.Split("\")[-1] #get the last part of the path $result = "03-22-2019" #get this date from some where else if ($result) { #check if pattern string exists in that file. $SEL = Select-String -Path <path location> -Pattern $result if ($SEL -ne $null) { Write-Host "`n $last Contains Matching date " } else { Write-Host "`n $last Does not Contains date" } } else { Write-Host "`ndate field is blank" } } else { $result = "03-22-2019" #get this date from some where else if ($result) { #check if pattern string exists in that file. $SEL = Select-String -Path <path location> -Pattern $result if ($SEL -ne $null) { Write-Host "`n $last Contains Matching date " } else { Write-Host "`n $last Does not Contains date" } } else { Write-Host "`ndate field is blank" } } } else { Write-Host "other file types" } CSS样式添加到image-rendering: pixelated元素中。

相关问题