changes in image size

This commit is contained in:
jain
2023-07-13 16:37:42 +05:30
parent 1ac6c7c01d
commit a16fecb1c9
3 changed files with 5 additions and 15 deletions

View File

@ -25,9 +25,7 @@ class UpdateJuniorProfile(viewsets.ViewSet):
request_data = request.data
image = request.data.get('image')
image_url = ''
img = Image.open(image)
width, height = img.size
if width == NUMBER['zero'] or height == NUMBER['zero']:
if image.size == NUMBER['zero']:
return custom_error_response(ERROR_CODE['2035'], response_status=status.HTTP_400_BAD_REQUEST)
if image:
filename = f"images/{image.name}"