jiaweiqi 2 rokov pred
rodič
commit
588bbf330a
2 zmenil súbory, kde vykonal 15 pridanie a 10 odobranie
  1. 13 8
      apps/images/models.py
  2. 2 2
      uis/views/dashboard/home.html

+ 13 - 8
apps/images/models.py

@@ -22,14 +22,19 @@ class ImagesManager(models.Manager):
             img = Image.open(fullname)
             width, height = img.size
             # 缩略图压缩宽或高最大200
-            if width > 200 or height > 200:
-                if width > height:
-                    size = (200, int(height * 200 / width))
-                elif width < height:
-                    size = (int(width * 200 / height), 200)
-                else:
-                    size = (200, 200)
-                img = img.resize(size, Image.ANTIALIAS)
+            # if width > 200 or height > 200:
+            #     if width > height:
+            #         size = (200, int(height * 200 / width))
+            #     elif width < height:
+            #         size = (int(width * 200 / height), 200)
+            #     else:
+            #         size = (200, 200)
+            #     img = img.resize(size, Image.ANTIALIAS)
+            #     img.save(fullname)
+            #     width, height = img.size
+
+            if width > 1440:
+                img = img.resize((1440, int((height / width) * 1440)), Image.ANTIALIAS)
                 img.save(fullname)
                 width, height = img.size
         except:

+ 2 - 2
uis/views/dashboard/home.html

@@ -84,7 +84,7 @@
         <div class="layui-col-md12">
             <div class="layui-row layui-col-space15">
                 <!-- 统计数据 -->
-                <div class="layui-col-md12">
+                <!-- <div class="layui-col-md12">
                     <div class="layui-card">
                         <div class="layui-card-header">数据概览</div>
                         <ul class="layui-col-md12 topPart">
@@ -102,7 +102,7 @@
                             </li>
                         </ul>
                     </div>
-                </div>
+                </div>-->
             </div>
         </div>
     </div>