排版图片修改
This commit is contained in:
@@ -196,21 +196,23 @@ page={{stage_page}},%号
|
||||
//文章图片地址
|
||||
$sIcon = empty($aProductionArticle['icon']) ? '' : $aProductionArticle['icon'];
|
||||
if(!empty($sIcon)){
|
||||
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon;
|
||||
// if(file_exists($sIconUrl)){
|
||||
// $sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
||||
// }else{
|
||||
// $sIcon = '';
|
||||
// }
|
||||
//下载图片
|
||||
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
|
||||
$aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
if(!empty($aImageInfo['data'])){
|
||||
$aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
|
||||
$sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
|
||||
$sIconUrl = ROOT_PATH.trim($this->sArticleIcon,'/').'/'.$sIcon;
|
||||
if(file_exists($sIconUrl)){
|
||||
$sIconUrl = str_replace(ROOT_PATH.'public/', '', $sIconUrl);
|
||||
$sIconUrl = '../../'.$sIconUrl;
|
||||
$sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
||||
}else{
|
||||
$sIcon = '';
|
||||
}
|
||||
// //下载图片
|
||||
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleIcon.'/'.$sIcon;
|
||||
// $aImageInfo = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
// if(!empty($aImageInfo['data'])){
|
||||
// $aImageInfo['data'] = './image/'.basename($aImageInfo['data']);
|
||||
// $sIcon = '\KeywordImage{'.$aImageInfo['data'].'}';
|
||||
// }else{
|
||||
// $sIcon = '';
|
||||
// }
|
||||
}
|
||||
$aSearch['{{article_icon}}'] = $sIcon;
|
||||
$aSearch['{{keywords}}'] = $sKeywords;
|
||||
@@ -314,21 +316,20 @@ page={{stage_page}},%号
|
||||
continue;
|
||||
}
|
||||
|
||||
// $sIconUrl = rtrim(ROOT_PATH).$this->sArticleIcon.'/'.$sIcon;
|
||||
// if(file_exists($sIconUrl)){
|
||||
// $sIcon = '\KeywordImage{'.$sIconUrl.'}';
|
||||
// }else{
|
||||
// $sIcon = '';
|
||||
// }
|
||||
//下载图片
|
||||
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
|
||||
$aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
if(empty($aResult['data'])){
|
||||
$sMainImageUrl = ROOT_PATH.trim($this->sArticleMainImage,'/').'/'.$aImageInfo['url'];
|
||||
if(!file_exists($sMainImageUrl)){
|
||||
continue;
|
||||
}
|
||||
// //下载图片
|
||||
// $sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
|
||||
// $aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
// if(empty($aResult['data'])){
|
||||
// continue;
|
||||
// }
|
||||
// $aImageSearch = ['{{img_url}}' => $aResult['data'],'{{img_title}}' => $aImageInfo['note'],'{{img_fig_sim}}' => 'img_fig_sim_'.$value['ami_id']];
|
||||
// $sImageTempalteInfo = str_replace(array_keys($aImageSearch), array_values($aImageSearch), $sImageTempalte);
|
||||
$aImageInfo['image_url'] = $aResult['data'];
|
||||
// $aImageInfo['image_url'] = $aResult['data'];
|
||||
$aImageInfo['image_url'] = $sMainImageUrl;
|
||||
$aDealImage = $this->dealImage($aImageInfo);
|
||||
if(empty($aDealImage['data'])){
|
||||
continue;
|
||||
@@ -642,7 +643,8 @@ page={{stage_page}},%号
|
||||
$isWideImage = $imageWidth > $wideImageThreshold;
|
||||
|
||||
// 生成LaTeX图片代码
|
||||
$sImageUrl = './image/'.basename($sImageUrl);
|
||||
$sImageUrl = str_replace(ROOT_PATH.'public/', '', $sImageUrl);
|
||||
$sImageUrl = '../../'.$sImageUrl;
|
||||
if ($isWideImage) {
|
||||
$latexLines[] = "\\begin{figure*}[htbp]"; // 使用figure*环境实现两栏
|
||||
$latexLines[] = " \\centering";
|
||||
|
||||
Reference in New Issue
Block a user