Exemplo n.º 1
0
        "--batch",
        help="batch process files. requires input and output directories",
        action="store_true")

    args = parser.parse_args()

    if args.batch:
        images = imageEdit.openImagesInDir(THISDIR + "/input/*")
        print(images)
        for imageRef in images:
            fileName, image = imageRef
            fileNameParts = fileName.split("\\")
            fileName = fileNameParts[len(fileNameParts) - 1]
            print(fileName)
            if args.radius is not None:
                image = imageEdit.roundCorners(image, int(args.radius))
            else:
                image = imageEdit.roundCorners(image, int(image.width / 2))
            imageEdit.saveImage(THISDIR + "/output/out-" + fileName, image)

    else:
        im = imageEdit.openImage(THISDIR + "/" + args.image)
        if args.radius is not None:
            im = imageEdit.roundCorners(im, int(args.radius))
        else:
            im = imageEdit.roundCorners(im, int(im.width / 2))

        if args.output is not None:
            outFileName = args.output
        else:
            outFileName = args.image
def test_roundCorners_0():
	'''
	Manual Check
	Desired Output: A square image 512x512 pixels
	'''
	imageEdit.saveImage(OUTPUT+ "/test_roundCorners_0.png", imageEdit.roundCorners(IMAGE, 0))
def test_roundCorners_256():
	'''
	Manual Check
	Desired Output: A circular image 512x512 pixels
	'''
	imageEdit.saveImage(OUTPUT+ "/test_roundCorners_256.png", imageEdit.roundCorners(IMAGE, 256))
def test_roundCornersPercent_50():
	'''
	Manual Check
	Desired Output: A circular image 512x512 pixels
	'''
	imageEdit.saveImage(OUTPUT+ "/test_roundCornersPercent_50.png", imageEdit.roundCorners(IMAGE, "50%"))