|
@@ -621,12 +621,17 @@ class Color extends Start_Controller {
|
|
}
|
|
}
|
|
else if($v != '')
|
|
else if($v != '')
|
|
{
|
|
{
|
|
- $imagePath = str_replace('http://'.$_SERVER['HTTP_HOST'],'/www/wwwroot/1.wepolicy.cn',$v);
|
|
|
|
- var_dump($imagePath);
|
|
|
|
- die;
|
|
|
|
- $imageData = file_get_contents($imagePath);
|
|
|
|
- $base64 = 'data:' . mime_content_type($imagePath) . ';base,' . base64_encode($imageData);
|
|
|
|
- $info_list[$key]['img'] = "<img width='70' src='".$base64."' data-src='".$v."'>";
|
|
|
|
|
|
+ $imageData = file_get_contents($v);
|
|
|
|
+ $finfo = new finfo(FILEINFO_MIME_TYPE);
|
|
|
|
+ $mimeType = $finfo->buffer($imageData);
|
|
|
|
+
|
|
|
|
+ // 转换为 Base64
|
|
|
|
+ $base64 = base64_encode($imageData);
|
|
|
|
+
|
|
|
|
+ // 构建 Data URI
|
|
|
|
+ $dataUri = 'data:' . $mimeType . ';base64,' . $base64;
|
|
|
|
+
|
|
|
|
+ $info_list[$key]['img'] = "<img width='70' src='".$$dataUri."'>";
|
|
}else{
|
|
}else{
|
|
$info_list[$key]['img'] = '';
|
|
$info_list[$key]['img'] = '';
|
|
}
|
|
}
|