max 128 inventory images

This commit is contained in:
2023-08-26 16:56:57 +02:00
parent a3cb90b96b
commit 916c4003be
19 changed files with 12 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env python3
#
# Example command: ./generate-items.py /home/`whoami`/Nextcloud/gynkhana/items/ ../gymkhana/items/inventory/ turno_cocina
#
import shutil, sys, glob, os, math
from pathlib import Path
from PIL import Image
@@ -46,8 +49,15 @@ def generateImage(inputFile, baseName):
originalImage = Image.open(inputFile)
scale = 0.15
newImage = originalImage.resize((math.ceil(originalImage.width * scale),math.ceil(originalImage.height * scale)))
biggerSide = originalImage.width
if(originalImage.width < originalImage.height):
biggerSide = originalImage.height
scale = 128 / biggerSide
#scale = 0.15
newImage = originalImage.resize((math.floor(originalImage.width * scale),math.floor(originalImage.height * scale)))
newImageOutputPath = outputDir + "assets/" + baseName + ".png"
print(f"{bcolors.OKCYAN}Image:{bcolors.ENDC} {newImageOutputPath} {bcolors.OKGREEN}generated.{bcolors.ENDC}")
newImage.save(newImageOutputPath)