mirror of
https://github.com/Rushilwiz/pfp-frame.git
synced 2025-04-03 20:00:17 -04:00
fix: fixed image sizing issue
This commit is contained in:
parent
c6a4223a87
commit
4d6959050b
1
Pipfile
1
Pipfile
|
@ -7,7 +7,6 @@ name = "pypi"
|
|||
django = "*"
|
||||
pillow = "*"
|
||||
django-allauth = "*"
|
||||
facebook-sdk = "*"
|
||||
gunicorn = "*"
|
||||
|
||||
[dev-packages]
|
||||
|
|
10
Pipfile.lock
generated
10
Pipfile.lock
generated
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "ebb9ed5721e8e2d2fbedddc2e1e637945ba2a445f8bb3979c1674736f4f4c1c4"
|
||||
"sha256": "b719a8798c5a56d92c68981d9b4ea57e17baf2b3c7cde5cdfb4444ad4f832ab1"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
|
@ -136,14 +136,6 @@
|
|||
"index": "pypi",
|
||||
"version": "==0.45.0"
|
||||
},
|
||||
"facebook-sdk": {
|
||||
"hashes": [
|
||||
"sha256:2e987b3e0f466a6f4ee77b935eb023dba1384134f004a2af21f1cfff7fe0806e",
|
||||
"sha256:cabcd2e69ea3d9f042919c99b353df7aa1e2be86d040121f6e9f5e63c1cf0f8d"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==3.1.0"
|
||||
},
|
||||
"gunicorn": {
|
||||
"hashes": [
|
||||
"sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e",
|
||||
|
|
|
@ -23,6 +23,8 @@ class Profile(models.Model):
|
|||
if bool(self.image):
|
||||
img = Image.open(self.image.path)
|
||||
frame = Image.open(settings.MEDIA_ROOT + "/frame.png")
|
||||
img.thumbnail((500, 500))
|
||||
img.thumbnail((300, 300))
|
||||
width, height = img.size
|
||||
frame.thumbnail((width, height))
|
||||
img.paste(frame, (0,0), frame)
|
||||
img.save(self.image.path)
|
|
@ -8,7 +8,6 @@ from urllib.request import urlretrieve
|
|||
from django.core.files import File
|
||||
|
||||
import requests
|
||||
import facebook
|
||||
|
||||
# Create your views here.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user