dever 4 سال پیش
والد
کامیت
24e4585ab8
3فایلهای تغییر یافته به همراه77 افزوده شده و 0 حذف شده
  1. 3 0
      app/collection/src/Api.php
  2. 7 0
      app/collection/src/Old.php
  3. 67 0
      app/collection/src/Pic.php

+ 3 - 0
app/collection/src/Api.php

@@ -441,6 +441,9 @@ class Api extends Core
                 $data['times'][$k]['child'] = Dever::db('collection/times')->child($where);
                 foreach ($data['times'][$k]['child'] as $k1 => $v1) {
                     $data['times'][$k]['child'][$k1]['visible'] = false;
+                    if (!$v1['end_year']) {
+                        $data['times'][$k]['child'][$k1]['end_year'] = $v1['year'];
+                    }
                 }
             }
         }

+ 7 - 0
app/collection/src/Old.php

@@ -257,4 +257,11 @@ class Old extends Core
         $data = Dever::db('collection/info')->fetchAll($sql);
         return $data;
     }
+
+    public function qq()
+    {
+        $link = 'https://v.qq.com/x/page/r32180b92yg.html';
+
+        echo Dever::qqvideo($link);die;
+    }
 }

+ 67 - 0
app/collection/src/Pic.php

@@ -0,0 +1,67 @@
+<?php
+
+namespace Collection\Src;
+
+use Dever;
+
+class Pic
+{
+	public function test()
+	{
+		$data = Dever::data() . 'window/';
+		$dest = $data . 'dest.jpg';
+		@unlink($dest);
+		
+		$canvas = $this->get();  
+        $color = new \ImagickPixel("white");
+
+        $offset = array(1000,1000);
+        $dest_x = 500;
+        $dest_y = 500;
+        $canvas->newImage($offset[0], $offset[1], $color, 'png');
+        //$canvas->paintfloodfillimage('transparent',2000,NULL,0,0);
+        /* 计算高度 */  
+        $x = ($offset[0] - $dest_x)/2;  
+        $y = ($offset[1] - $dest_y)/2;  
+        /* 合并图片  */  
+
+        $source = $this->get($data . 'zuoshang.png');
+        $canvas->compositeImage($source, \Imagick::COMPOSITE_OVER, 0, 0);
+
+        $source = $this->get($data . 'youshang.png');
+        $canvas->compositeImage($source, \Imagick::COMPOSITE_OVER, 500, 0);
+
+        $source = $this->get($data . 'youxia.png');
+        $canvas->compositeImage($source, \Imagick::COMPOSITE_OVER, 500, 500);
+
+        $source = $this->get($data . 'zuoxia.png');
+        $canvas->compositeImage($source, \Imagick::COMPOSITE_OVER, 0, 500);
+        
+        $source = $this->get($data . 'shang.png');
+        $canvas->compositeImage($source, \Imagick::COMPOSITE_OVER, 289, 0);
+
+        $canvas->setCompression(\Imagick::COMPRESSION_JPEG); 
+        $canvas->setCompressionQuality(100);
+
+        $canvas->writeImage($dest);
+
+        $dest = 'http://192.168.33.10/dreamland/data/window/dest.jpg?time=' . time();
+
+        echo '<img src="'.$dest.'">';die;
+	}
+
+	private function get($image = false)
+    {
+        if ($image && strstr($image, 'http')) {
+            $content = file_get_contents($image);
+            $im = new \Imagick();
+            $im->readImageBlob($content);
+        } elseif ($image) {
+            $im = new \Imagick($image);
+        } else {
+        	$im = new \Imagick();
+        }
+        
+        return $im;
+    }
+}