import imageEdit

if __name__ == "__main__": # pragma: no cover

	# Image in should be 512px
	images = imageEdit.openImagesInDir(THISDIR + "/input/*", "logo")
	for imageRef in images:
		fileName, squareImage = imageRef
		fileNameParts = fileName.split(os.sep)
		fileName = fileNameParts[len(fileNameParts)-1]
		imageEdit.logPrint(fileName, "bold")
		outputDir = THISDIR + "/output/" + fileName + "/proj-icon"

		# Proj-icon does not want to be a mask

		if (imageEdit.getImageDesc(squareImage) == "mask"):
			textName = fileName.split('.')[0]
			imageEdit.saveImage(outputDir + "/name.png",
				imageEdit.addDropShadowSimple(
					imageEdit.roundCornersAntiAlias(
						imageEdit.resizeImageSquare(
							imageEdit.addText(squareImage, textName),
						"0.5x"),
					64),
				[-10, 10])
			)


			squareImage = imageEdit.removeImagePadding(squareImage, 64)

def test_getImageDesc_mask():
	assert(imageEdit.getImageDesc(imageEdit.resizeImageSquare(IMAGE, 640)) == "mask")
def test_getImageDesc_null():
	assert(imageEdit.getImageDesc(imageEdit.resizeImageSquare(IMAGE, 256)) == "unknown")
def test_getImageDesc_icon():
	assert(imageEdit.getImageDesc(IMAGE) == "icon")