非標準形式の画像を、PIL画像に変換して表示できるnumpy配列に動的にロード/生成するために使用できるdjangoモデルがあります。
class Thing(models.Model):
def gethttpimage(self):
img = ....
# get find file and load into numpy array as img
image = Image.fromarray(img.astype(np.uint8))
response = HttpResponse(content_type="image/png")
image.save(response, "PNG")
return response
また、この応答を URL に渡すビューもあり、うまく機能します。
django-imagekit や django-photologue などのパッケージを使用して、生成した画像をサムネイル ギャラリーなどとして表示し、imagekit が提供する他のさまざまな機能を使用したいと考えています。
django-imagekit または django-photologue でこれを達成するにはどうすればよいですか?
編集:私はイメージキットに心を向けていません。画像ギャラリーやその他の情報を使用してビューを構築できるようにしたい