作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

用户头像

... ... @@ -2,6 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="73de7205-e736-4b59-941a-a54ab4506a41" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/public/tou.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/OtherController.php" afterPath="$PROJECT_DIR$/api/index/controller/OtherController.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
... ... @@ -16,8 +18,8 @@
<file leaf-file-name="OtherController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/OtherController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="284">
<caret line="326" column="50" lean-forward="false" selection-start-line="326" selection-start-column="50" selection-end-line="326" selection-end-column="50" />
<state relative-caret-position="257">
<caret line="328" column="62" lean-forward="true" selection-start-line="328" selection-start-column="62" selection-end-line="328" selection-end-column="62" />
<folding>
<element signature="e#129#158#0#PHP" expanded="true" />
<element signature="e#344#512#0#PHP" expanded="false" />
... ... @@ -36,12 +38,11 @@
<element signature="e#6020#6946#0#PHP" expanded="false" />
<element signature="e#6952#7256#0#PHP" expanded="false" />
<element signature="e#7261#7650#0#PHP" expanded="false" />
<element signature="e#10525#11316#0#PHP" expanded="false" />
<element signature="e#11336#12200#0#PHP" expanded="false" />
<element signature="e#12227#12627#0#PHP" expanded="false" />
<element signature="e#12651#13224#0#PHP" expanded="false" />
<element signature="e#13247#14057#0#PHP" expanded="false" />
<element signature="e#14064#15117#0#PHP" expanded="false" />
<element signature="e#10737#11528#0#PHP" expanded="false" />
<element signature="e#11548#12412#0#PHP" expanded="false" />
<element signature="e#12439#12839#0#PHP" expanded="false" />
<element signature="e#12863#13436#0#PHP" expanded="false" />
<element signature="e#13459#14269#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -127,8 +128,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="61" />
<option name="y" value="77" />
<option name="x" value="-60" />
<option name="y" value="86" />
<option name="width" value="1868" />
<option name="height" value="1019" />
</component>
... ... @@ -253,15 +254,15 @@
<workItem from="1569486627319" duration="2740000" />
<workItem from="1569494185536" duration="1054000" />
<workItem from="1569544728303" duration="25104000" />
<workItem from="1569716359574" duration="27168000" />
<workItem from="1569716359574" duration="28303000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="426159000" />
<option name="totallyTimeSpent" value="427294000" />
</component>
<component name="ToolWindowManager">
<frame x="61" y="77" width="1868" height="1019" extended-state="0" />
<frame x="-60" y="86" width="1868" height="1019" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18086283" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
... ... @@ -296,7 +297,6 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/api/index/controller/CommonController.php" />
<entry file="file://$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/statistic/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
... ... @@ -520,11 +520,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/bg.png">
<provider selected="true" editor-type-id="images">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/ResourceController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="224">
... ... @@ -698,10 +693,20 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/bg.png">
<provider selected="true" editor-type-id="images">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/tou.png">
<provider selected="true" editor-type-id="images">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/OtherController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="284">
<caret line="326" column="50" lean-forward="false" selection-start-line="326" selection-start-column="50" selection-end-line="326" selection-end-column="50" />
<state relative-caret-position="257">
<caret line="328" column="62" lean-forward="true" selection-start-line="328" selection-start-column="62" selection-end-line="328" selection-end-column="62" />
<folding>
<element signature="e#129#158#0#PHP" expanded="true" />
<element signature="e#344#512#0#PHP" expanded="false" />
... ... @@ -720,12 +725,11 @@
<element signature="e#6020#6946#0#PHP" expanded="false" />
<element signature="e#6952#7256#0#PHP" expanded="false" />
<element signature="e#7261#7650#0#PHP" expanded="false" />
<element signature="e#10525#11316#0#PHP" expanded="false" />
<element signature="e#11336#12200#0#PHP" expanded="false" />
<element signature="e#12227#12627#0#PHP" expanded="false" />
<element signature="e#12651#13224#0#PHP" expanded="false" />
<element signature="e#13247#14057#0#PHP" expanded="false" />
<element signature="e#14064#15117#0#PHP" expanded="false" />
<element signature="e#10737#11528#0#PHP" expanded="false" />
<element signature="e#11548#12412#0#PHP" expanded="false" />
<element signature="e#12439#12839#0#PHP" expanded="false" />
<element signature="e#12863#13436#0#PHP" expanded="false" />
<element signature="e#13459#14269#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -326,13 +326,16 @@ class OtherController extends RestBaseController
->find();
$avatar = $this->request->param('avatar');
$image = \think\Image::open(ROOT_PATH."public/bg.png");
$tou = \think\Image::open(ROOT_PATH."public/tou.png");
$tou->thumb(90,90,\think\Image::THUMB_CENTER)->save(ROOT_PATH."public/tou.png");
$text = "期待你的加入";
$remark = "长按识别二维码识别小程序";
$result = $image
->water(ROOT_PATH."public/tou.png",[35,48],100)
->water(ROOT_PATH."public/upload/$code",[456,590],100)
->text($remark,ROOT_PATH.'public/static/font-awesome/fonts/PingFang Medium.ttf',14,'#FFFFFF',[66,659])
->text($text,ROOT_PATH.'public/static/font-awesome/fonts/PingFang Medium.ttf',12,'#FFFFFF',[132,100])
->text($job['job_title'],ROOT_PATH.'public/static/font-awesome/fonts/PingFang Medium.ttf',20,'#FFFFFF',[100,200])
->text($remark,ROOT_PATH.'public/static/font-awesome/fonts/PingFang Medium.ttf',16,'#FFFFFF',[66,659])
->text($text,ROOT_PATH.'public/static/font-awesome/fonts/PingFang Medium.ttf',14,'#FFFFFF',[132,100])
->text($job['job_title'],ROOT_PATH.'public/static/font-awesome/fonts/PingFang Medium.ttf',22,'#FFFFFF',[100,200])
->text($user['user_nickname'],ROOT_PATH.'public/static/font-awesome/fonts/PingFang Medium.ttf',16,'#FFFFFF',[132,60]);
$result->save($savePath."poster_".$user_id."_$job_id.png");
$this->success('SUCCESS',['url'=>cmf_get_image_url("poster/poster_".$user_id."_$job_id.png")]);
... ... @@ -439,41 +442,4 @@ class OtherController extends RestBaseController
return $result;
}
public function yuanjiao($imgpath){
$ext= pathinfo($imgpath);
$src_img = null;
switch ($ext['extension']) {
case 'jpg':
$src_img = imagecreatefromjpeg($imgpath);
break;
case 'png':
$src_img = imagecreatefrompng($imgpath);
break;
}
$wh= getimagesize($imgpath);
$w=$wh[0];
$h= $wh[1];
$w= min($w, $h);
$h= $w;
$img = imagecreatetruecolor($w, $h);
//这一句一定要有
imagesavealpha($img, true);
//拾取一个完全透明的颜色,最后一个参数127为全透明
$bg = imagecolorallocatealpha($img, 255, 255, 255, 127);
imagefill($img, 0, 0, $bg);
$r= $w / 2; //圆半径
$y_x = $r; //圆心X坐标
$y_y = $r; //圆心Y坐标
for ($x = 0; $x < $w; $x++) {
for ($y = 0; $y < $h; $y++) {
$rgbColor = imagecolorat($src_img, $x, $y);
if (((($x - $r) * ($x - $r) + ($y - $r) * ($y - $r)) < ($r * $r))) {
imagesetpixel($img, $x, $y, $rgbColor);
}
}
}
return $img;
}
}
\ No newline at end of file
... ...