package uo.idoc;

import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.UUID;

import javax.imageio.ImageIO;

public class ImageDiffWriter implements DiffWorker {

  private final String diffPath;

  public ImageDiffWriter(String diffPath) {
    this.diffPath = diffPath;
  }

  public void run(ByteArrayDifference diff) {
    try {
      File diffFile = new File(diffPath, UUID.randomUUID().toString() + ".png");
      System.out.println("Found difference! Creating diff image: " + diffFile.toPath().toString());
      BufferedImage oldImage = ImageIO.read(new ByteArrayInputStream(diff.getOldData()));
      BufferedImage newImage = ImageIO.read(new ByteArrayInputStream(diff.getNewData()));

      BufferedImage diffImage = DiffImageMaker.produceDiffImage(oldImage, newImage);

      ImageIO.write(diffImage, "png", diffFile);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
}

@@ -134,16 +134,51 @@
 eption;%0A
+import java.text.SimpleDateFormat;%0A
 import j
@@ -186,20 +186,20 @@
 va.util.
-UUID
+Date
 ;%0A%0Aimpor
@@ -492,35 +492,69 @@
 th, 
-UUID.randomUUID().toString(
+new SimpleDateFormat(%22yyyy-MM-dd_HH-mm-ss%22).format(new Date()
 ) + 

Change screenshot file name format to include timestamp. Fixes #1