+ if path and default_storage.exists(path):
|
|
|
115
|
+ default_storage.delete(path)
|
|
|
116
|
+
|
|
|
117
|
+ return DotDict({
|
|
|
118
|
+ 'ext': ext,
|
|
|
119
|
+
|
|
|
120
|
+ 'photo_md5': photo_md5,
|
|
|
121
|
+
|
|
|
122
|
+ 'photo_path': photo.photo_path,
|
|
|
123
|
+ 'photo_w': photo.photo_w,
|
|
|
124
|
+ 'photo_h': photo.photo_h,
|
|
|
125
|
+
|
|
|
126
|
+ 'photo_watermark_path': photo.photo_watermark_path,
|
|
|
127
|
+
|
|
|
128
|
+ 'photo_thumbnail_path': photo.photo_thumbnail_path,
|
|
|
129
|
+ 'photo_thumbnail_w': photo.photo_thumbnail_w,
|
|
|
130
|
+ 'photo_thumbnail_h': photo.photo_thumbnail_h,
|
|
|
131
|
+
|
|
|
132
|
+ 'photo_thumbnail2_path': photo.photo_thumbnail2_path,
|
|
|
133
|
+ 'photo_thumbnail2_w': photo.photo_thumbnail2_w,
|
|
|
134
|
+ 'photo_thumbnail2_h': photo.photo_thumbnail2_h,
|
|
|
135
|
+ })
|
|
|
|
@@ -3,10 +3,6 @@
|
|
3
|
3
|
from django.conf import settings
|
|
4
|
4
|
|
|
5
|
5
|
|
|
6
|
|
-def img_url(img_path):
|
|
7
|
|
- return '{}/{}'.format(settings.IMG_DOMAIN, img_path) if img_path else ''
|
|
8
|
|
-
|
|
9
|
|
-
|
|
10
|
6
|
def share_url(photo_id):
|
|
11
|
7
|
return '{}/gp/{}'.format(settings.DOMAIN, photo_id) if photo_id else ''
|
|
12
|
8
|
|