1
0
Fork 0
mirror of https://github.com/ldericher/fftcgtool synced 2025-01-15 15:02:59 +00:00

minor bug fixes

This commit is contained in:
Jörn-Michael Miehe 2018-11-02 23:39:09 +01:00
parent 77c0e9d3fb
commit 52216406a6
4 changed files with 13 additions and 6 deletions

View file

@ -18,4 +18,4 @@ WORKDIR "/app"
COPY . .
CMD ["./main.py"]
ENTRYPOINT ["./main.py"]

View file

@ -66,7 +66,11 @@ class Card:
# download and resize card image
def get_image(self, resolution):
try:
response = requests.get(self._iurl)
except:
return False
im = Image.open(BytesIO(response.content))
im = im.convert("RGB")
im = im.resize(resolution, Image.BICUBIC)

View file

@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3
import argparse
import json

View file

@ -27,9 +27,12 @@ class imageLoader(threading.Thread):
# take next card
i, card = self.__queue.get()
# fetch card image
# fetch card image (retry on fail)
while True:
logger.info("get image for card {}".format(card))
im = card.get_image(self.__resolution)
if im:
break
# paste image in correct position
self.__lock.acquire()