models.py に次の画像フィールドがあります (以下のコードを参照)。
画像の固定幅と高さを常に 100x100pxに設定したい
以下のコードはすでにシステムにあったものです。幅と高さがどのように渡されるのか、またはこのコードを使用して幅と高さを固定サイズに設定できるかどうかはわかりません。
image = models.ImageField(
upload_to="profiles",
height_field="image_height",
width_field="image_width",
null=True,
blank=True,
editable=True,
help_text="Profile Picture",
verbose_name="Profile Picture"
)
image_height = models.PositiveIntegerField(null=True, blank=True, editable=False, default="100")
image_width = models.PositiveIntegerField(null=True, blank=True, editable=False, default="100")