Parcourir la source

Logic was wrong for selecting the image width.

pull/24/head
Ben Kurtovic il y a 10 ans
Parent
révision
6acb88a156
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. +1
    -1
      copyvios/background.py

+ 1
- 1
copyvios/background.py Voir le fichier

@@ -108,7 +108,7 @@ def _get_site():
def _build_url(screen, filename, url, imgwidth, imgheight): def _build_url(screen, filename, url, imgwidth, imgheight):
width = screen["width"] width = screen["width"]
if float(imgwidth) / imgheight > float(screen["width"]) / screen["height"]: if float(imgwidth) / imgheight > float(screen["width"]) / screen["height"]:
width = int(float(imgwidth) / imgheight * screen["width"])
width = int(float(imgwidth) / imgheight * screen["height"])
if width >= imgwidth: if width >= imgwidth:
return url return url
url = url.replace("/commons/", "/commons/thumb/") url = url.replace("/commons/", "/commons/thumb/")


Chargement…
Annuler
Enregistrer