ptc = Image.open(mstr_datafolder + "textures/tile/completion/p" + str(randrange(1, len(patches)+1)) + ".png")\r
# Rotate it\r
ptc = ptc.rotate(randrange(0, 360), expand=True)\r
+\r
+ # Make sure ortho generation does not crash\r
+ if ptc.width >= mstr_photores:\r
+ ptc = ptc.resize((1536, 1536), Image.Resampling.BILINEAR)\r
+\r
# Adjust alpha on this image\r
ptc_p = ptc.load()\r
for y in range(ptc.height):\r