ass="same-code nl-2 ol-2"> 14 14
     thumb_width = min(max_width, width)
15 15
     thumb_height = height / width * thumb_width
16
-    im.thumbnail((thumb_width, thumb_height))
17
-    im.save(im_thumbnail_path or im_path, im.format or 'JPEG')
16
+    im.thumbnail((thumb_width, thumb_height), Image.ANTIALIAS)
17
+    im.save(im_thumbnail_path or im_path, im.format or 'JPEG', quality=100)
18 18
     return width, height, thumb_width, thumb_height

thermometer - Gogs: Go Git Service

Nenhuma Descrição

aep_views.py 1.5KB

    # -*- coding: utf-8 -*- from __future__ import division import base64 import json from django_logit import logit from django_response import response from equipment.models import AepThermometerMeasureLogInfo from utils.convert import hex2ascii @logit def aep_upload_temperature(request): # { # "upPacketSN": -1, # "upDataSN": -1, # "topic": "v1/up/ad", # "timestamp": 1636096959410, # "tenantId": "2000051017", # "serviceId": "", # "protocol": "lwm2m", # "productId": "15091846", # "payload": { # "APPdata": "MjIyMzk0" # }, # "messageType": "dataReport", # "deviceType": "", # "deviceId": "6b34c9d2d06b4965b4fe505e6d6c342c", # "assocAssetId": "", # "IMSI": "460113179251578", # "IMEI": "355558100904547" # } reqdata = request.POST or json.loads(request.body) imei = reqdata.get('IMEI', '') payload = reqdata.get('payload') or {} appdata = payload.get('APPdata', '') appdata = base64.decodebytes(appdata.encode()).hex() AepThermometerMeasureLogInfo.objects.create( imei=imei, upload_temperature_info=reqdata, temperature_info=[appdata[:2], appdata[2:4], appdata[4:6]], battery_info=[appdata[6:8], appdata[8:10], appdata[10:12]], temperature=f'{hex2ascii(appdata[:2])}{hex2ascii(appdata[2:4])}.{hex2ascii(appdata[4:6])}', battery=f'{hex2ascii(appdata[6:8])}{hex2ascii(appdata[8:10])}.{hex2ascii(appdata[10:12])}', ) return response()
kodo - Gogs: Go Git Service

No Description

huangqimin001: 77224d884a :art: Support maintenance_tracking_info_subscribe 5 years ago
..
__init__.py fe160a49f1 :art: Kuaidi100 5 years ago
autonumber.py fe160a49f1 :art: Kuaidi100 5 years ago
billparcels.py fe160a49f1 :art: Kuaidi100 5 years ago
maptrack.py fe160a49f1 :art: Kuaidi100 5 years ago
sms.py fe160a49f1 :art: Kuaidi100 5 years ago
subscribe.py 77224d884a :art: Support maintenance_tracking_info_subscribe 5 years ago
synquery.py fe160a49f1 :art: Kuaidi100 5 years ago
快递100快递公司标准编码-20210922162915.xls 22a8246c88 :art: init_express_company 5 years ago