|
@@ -68,15 +68,39 @@ class Qiniu extends Core implements Config
|
|
|
*
|
|
|
* @return mixed
|
|
|
*/
|
|
|
- public function handle_w($id)
|
|
|
+ public function handle_w($id, $source = false)
|
|
|
{
|
|
|
$config = Dever::load('upload/pic_water-one', $id);
|
|
|
if ($config) {
|
|
|
- $this->name .= '_w' . $id;
|
|
|
-
|
|
|
- $water = array('water'=> $config['water'], 'position'=> ($config['water_position'] ? $config['water_position'] : 1));
|
|
|
-
|
|
|
- $this->img()->mark($this->output['file'], $water, true, $this->file());
|
|
|
+ if (isset(Dever::config('base')->handle_w) && Dever::config('base')->handle_w) {
|
|
|
+
|
|
|
+ list($yun, $file) = $this->yun();
|
|
|
+ $this->name .= '_w' . $id;
|
|
|
+ $file = $this->file();
|
|
|
+ $options = array();
|
|
|
+ Dever::load('upload/lib/view/qiniu')->connect($yun, $this->config, $file)->upload($file, Dever::config('base')->handle_w, $options);
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return;
|
|
|
+ if (!$source) {
|
|
|
+ $source = $this->output['file'];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!strstr($source, 'http')) {
|
|
|
+ $source = $this->data['host'] . $source;
|
|
|
+ }
|
|
|
+ if (strstr($source, '?')) {
|
|
|
+ $prefix = '&';
|
|
|
+ } else {
|
|
|
+ $prefix = '?';
|
|
|
+ }
|
|
|
+ $dest = $source . $prefix . 'watermark/1/image/a29kbzovL2RldmVsb3Blci1kb2N1bWVudHMtaW1hZ2UvcWluaXV5dW4ucG5n/dissolve/50/gravity/SouthEast/dx/20/dy/20/ws/0.2';
|
|
|
+
|
|
|
+ $dest .= '|imageslim';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|