0
我正在使用Laravel。我正在尝试使用Imgix排版端点将生物图像的职员生物展现出来。当我单独使用排版端点时,我会得到正确的格式化文本。但是,当我编码base64然后附加到生物图像uri,图像看起来很好,但没有文字覆盖。有谁知道我做错了什么?为什么不使用Imgix排版端点正确覆盖
下面是函数
public function bioEncode($bio, $align) {
$bioNoSpaces = str_replace(' ', '+', $bio);
$bioTextUrl = base64_encode("http://newsong.imgix.net/~text?txt=" . $bioNoSpaces . "&txtclr=fff&txtsize=20&w=800&txtpad=20&txtfont=avenir-black&txtalign=center");
if($align == 0) {
$newUrl = "http://newsong.imgix.net/staffProfile/cameron-profile-desktop.jpg?fit=crop&crop=top&w=1220&h=500&mark64=" . $bioTextUrl . "&markalign=left,middle&markpad=0";
return $newUrl;
} else {
$newUrl = "http://newsong.imgix.net/staffProfile/cameron-profile-desktop.jpg?fit=crop&crop=top&w=1220&h=500&mark64=" . $bioTextUrl . "&markalign=right,middle&markpad=0";
return $newUrl;
}
}
这里是我打电话的功能
srcset="{{$staff->bioEncode($staff->staff_bio, $staff->desktop_img_text_side)}}"
进入这个时候
进入Imgix沙盒:https://sandbox.imgix.com/create 此网址的作品。我编码并解码了base64字符串,似乎没有错。
我还是新来的Php,所以任何帮助都非常感谢。