diff options
author | Magnus Hagander | 2022-06-26 19:31:44 +0000 |
---|---|---|
committer | Magnus Hagander | 2022-06-26 22:04:44 +0000 |
commit | e4d50c8012b5403aa1e8a2341ab77ce4182cdaac (patch) | |
tree | 2f9bad5f7fdfec66970c9e86bc299d2990a37769 /postgresqleu/confreg/admin.py | |
parent | 897738b31e86ba297285d232aa4b21409fc25e66 (diff) |
Support higher resolution speaker photos
This adds a new field to the speaker model supporting 512x512 sized
speaker photos.
It also changes the speaker form (as well as the backend form) to accept
any size image and resize it into the bounding box of 512x512. There is
no reason to force the speaker to do that manually, computers are good
at such things. The rezied image will be padded as necessary to the full
512x512 with transparent background, which also means the storage format
of the new photos will be PNG in order to support that transparency.
Whenever the photo is updated, a downscaled copy will automatically be
generated that's 128x128 for backwards compatibilty as well as
thumbnailing. There is no interface to independently edit this lower
resolution photo.
Fixes #15
Diffstat (limited to 'postgresqleu/confreg/admin.py')
-rw-r--r-- | postgresqleu/confreg/admin.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/postgresqleu/confreg/admin.py b/postgresqleu/confreg/admin.py index 1e4657a2..f922d55e 100644 --- a/postgresqleu/confreg/admin.py +++ b/postgresqleu/confreg/admin.py @@ -286,7 +286,7 @@ class ConferenceAdditionalOptionAdmin(admin.ModelAdmin): class SpeakerAdminForm(ConcurrentProtectedModelForm): - exclude_fields_from_validation = ['photo', ] + exclude_fields_from_validation = ['photo', 'photo512', ] class Meta: model = Speaker @@ -294,7 +294,7 @@ class SpeakerAdminForm(ConcurrentProtectedModelForm): class SpeakerAdmin(admin.ModelAdmin): - list_display = ['user', 'email', 'fullname', 'has_abstract', 'has_photo'] + list_display = ['user', 'email', 'fullname', 'has_abstract', 'has_photo', 'has_photo512'] search_fields = ['fullname', 'user__email'] autocomplete_fields = ('user', ) ordering = ['fullname'] |