Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bde/nk20
  • mcngnt/nk20
2 results
Show changes
Commits on Source (8)
......@@ -238,17 +238,18 @@ class ProfilePictureUpdateView(LoginRequiredMixin, FormMixin, DetailView):
h = form.cleaned_data['height']
# image crop and resize
image_file = io.BytesIO(image_field.read())
ext = image_field.name.split('.')[-1]
ext = image_field.name.split('.')[-1].lower()
#TODO: support GIF format
image = Image.open(image_file)
image = image.crop((x, y, x+w, y+h))
image_clean = image.resize((settings.PIC_WIDTH,
settings.PIC_RATIO*settings.PIC_WIDTH),
Image.ANTIALIAS)
image_file = io.BytesIO()
image_clean.save(image_file,ext)
image_clean.save(image_file,"PNG")
image_field.file = image_file
# renaming
filename = "{}_pic.{}".format(self.object.note.pk, ext)
filename = "{}_pic.png".format(self.object.note.pk)
image_field.name = filename
self.object.note.display_image = image_field
self.object.note.save()
......
......@@ -9,7 +9,7 @@ server {
# the port your site will be served on
listen 80;
# the domain name it will serve for
server_name note.comby.xyz; # substitute your machine's IP address or FQDN
server_name note.example.org; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
......
......@@ -51,4 +51,10 @@ SESSION_COOKIE_AGE = 60 * 60 * 3
# CAS Client settings
# Can be modified in secrets.py
CAS_SERVER_URL = "https://note.comby.xyz/cas/"
CAS_SERVER_URL = "http://localhost:8000/cas/"
STATIC_ROOT = '' # not needed in development settings
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')]