static File cropToLeftScreenInPlace(File imageFile) { ret cropToLeftScreenInPlace(imageFile, screenWidth(), screenHeight()); } static File cropToLeftScreenInPlace(File imageFile, int width, int height default Int.MAX_VALUE) { if (!isFile(imageFile)) null; loading "Crop image file" { BufferedImage img = loadImage2(imageFile); if (img.getWidth() <= width && img.getHeight() <= height) { print("Nothing to crop: " + imageFile); ret imageFile; } img = clipBufferedImage(img, 0, 0, width, height); File atticFile = appendToBaseFileName(imageFile, ".uncropped"); renameFileVerbose(imageFile, atticFile); saveImageVerbose(imageFile, img); print("Image cropped to " + width + " pixels"); ret imageFile; } }