mirror of
https://github.com/ldericher/fftcgtool
synced 2025-01-15 15:02:59 +00:00
minor bug fixes
This commit is contained in:
parent
77c0e9d3fb
commit
52216406a6
4 changed files with 13 additions and 6 deletions
|
@ -18,4 +18,4 @@ WORKDIR "/app"
|
|||
|
||||
COPY . .
|
||||
|
||||
CMD ["./main.py"]
|
||||
ENTRYPOINT ["./main.py"]
|
||||
|
|
4
card.py
4
card.py
|
@ -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)
|
||||
|
|
2
main.py
2
main.py
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python3
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
|
5
opus.py
5
opus.py
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue