Wednesday, October 24, 2012

Cleaning Scans with Photoshop

If you want to scan more than one photo at a time, you can do it with some help from Photoshop's crop and straighten feature. You can automate this, and use a script to clean up multiple scans. However, this process sometimes creates a large number of "pieces" - more than you want. If you know you have only a single image, you can use Photoshop's trim instead to remove excess whitespace.

Saturday, August 4, 2012

Testing an ant Task

I had to test the SchemaCrawler ant task. Some research shows

  1. Include the ant testunit jar - in a Maven project you can add a dependency such as

  1. Extend your test case from
  2. Write a setup like
  public void setUp()
    throws Exception
    configureProject( "./build.xml" );
  1. Write your test cases, with the methods starting with "test" (as in the classic JUnit)
  public void testAntTask()
    throws Exception
    final File testOutputFile = File.createTempFile("schemacrawler.",
    setAntProjectProperty("outputfile", testOutputFile.getAbsolutePath());

    // some asserts here

  1. You can set properties with the utility method
  private void setAntProjectProperty(final String name, final String value)
    final Project antProject = getProject();
    antProject.setProperty(name, value);