🐛 fix bug for extensions

main
HugoooR 1 year ago
parent 246d7a55ad
commit 1ae08b2c51

@ -20,7 +20,7 @@ from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path("image/", include("init_image.urls")),
path("", include("init_image.urls")),
path("admin/", admin.site.urls),
]

@ -22,7 +22,9 @@ def black_white(request):
image = request.FILES['image']
nom_image = str(image)
nom_fichier, extension = nom_image.split(".")
nom_fichier = nom_image.split(".")[0]
extension = nom_image.split(".")[-1]
if extension not in tableau_extension:
return render(request, 'init_image/black_white.html', context={"image_classique" : False,
@ -47,7 +49,9 @@ def page_gray(request):
image = request.FILES['image']
nom_image = str(image)
nom_fichier, extension = nom_image.split(".")
nom_fichier = nom_image.split(".")[0]
extension = nom_image.split(".")[-1]
if extension not in tableau_extension:
return render(request, 'init_image/gray.html', context={"image_classique" : False,
@ -72,7 +76,9 @@ def resize_picture(request):
image = request.FILES['image']
nom_image = str(image)
nom_fichier, extension = nom_image.split(".")
nom_fichier = nom_image.split(".")[0]
extension = nom_image.split(".")[-1]
if extension not in tableau_extension:
return render(request, 'init_image/resize.html', context={"image_classique" : False,
@ -143,7 +149,9 @@ def alignement_vertical(request):
for image in tableau_images:
nom_image = str(image)
nom_fichier, extension = nom_image.split(".")
nom_fichier = nom_image.split(".")[0]
extension = nom_image.split(".")[-1]
if extension not in tableau_extension:
return render(request, 'init_image/align_vertical.html', context={"image_classique" : False,
'message_erreur' : 'Erreur : mauvaise extension (jpeg/jpg, png ou svg)'})
@ -214,7 +222,9 @@ def alignement_horizontal(request):
for image in tableau_images:
nom_image = str(image)
nom_fichier, extension = nom_image.split(".")
nom_fichier = nom_image.split(".")[0]
extension = nom_image.split(".")[-1]
if extension not in tableau_extension:
return render(request, 'init_image/align_horizontal.html', context={"image_classique" : False,
'message_erreur' : 'Erreur : mauvaise extension (jpeg/jpg, png ou svg)'})
@ -254,8 +264,12 @@ def fusion(request):
nom_image = str(image)
nom_image2 = str(image2)
nom_fichier, extension = nom_image.split(".")
nom_fichier, extension2 = nom_image2.split(".")
nom_fichier = nom_image.split(".")[0]
extension = nom_image.split(".")[-1]
nom_fichier = nom_image2.split(".")[0]
extension2 = nom_image2.split(".")[-1]
if extension not in tableau_extension or extension2 not in tableau_extension:
return render(request, 'init_image/fusion.html', context={"image_classique" : False,
@ -303,7 +317,8 @@ def animation(request):
for image in tableau_images:
nom_image = str(image)
nom_fichier, extension = nom_image.split(".")
nom_fichier = nom_image.split(".")[0]
extension = nom_image.split(".")[-1]
if extension not in tableau_extension:
return render(request, 'init_image/animation.html', context={"image_classique" : False,
'message_erreur' : 'Erreur : mauvaise extension (jpeg/jpg, png ou svg)'})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 MiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 777 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 314 KiB

Loading…
Cancel
Save