Add mime type to generated File objects
This commit is contained in:
parent
14a0c12457
commit
518a01052c
1 changed files with 2 additions and 2 deletions
|
@ -152,7 +152,7 @@ class KRPanoConverter:
|
|||
assert res.getcode() == 200
|
||||
content = res.read()
|
||||
fo = ContentFile(content, name=f"{tile}_{maxzoom}_{y}_{x}.jpg")
|
||||
file = File.objects.create(conversion=self.conversion, file=fo)
|
||||
file = File.objects.create(conversion=self.conversion, file=fo, mime_type="image/jpeg")
|
||||
r_array.append(file)
|
||||
x += 1
|
||||
except Exception as e:
|
||||
|
@ -187,7 +187,7 @@ class KRPanoConverter:
|
|||
res = HTTPRequest(cur).open()
|
||||
assert res.getcode() == 200
|
||||
fo = ContentFile(res.read())
|
||||
file = File.objects.create(conversion=self.conversion, file=fo)
|
||||
file = File.objects.create(conversion=self.conversion, file=fo, mime_type="image/jpeg")
|
||||
output += [file]
|
||||
|
||||
return output
|
||||
|
|
Loading…
Reference in a new issue