Print

Print


Commit in CDMS/src/CDMS/Partridge/ImageNavigatorI on MAIN
CompressImages.java+55added 1.1
ImageNavigator.java+12-71.1 -> 1.2
+67-7
1 added + 1 modified, total 2 files
Update to current code

CDMS/src/CDMS/Partridge/ImageNavigatorI
CompressImages.java added at 1.1
diff -N CompressImages.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ CompressImages.java	9 Dec 2010 19:14:36 -0000	1.1
@@ -0,0 +1,55 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package CDMS.Partridge.ImageNavigatorI;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+
+import java.io.IOException;
+import javax.imageio.ImageIO;
+
+/**
+ *
+ * @author richp
+ */
+public class CompressImages {
+
+    public static void main(String[] args) throws IOException {
+
+        String idir = "f:/CDMS/IZipG10F_Side2/";
+        String odir = "c:/CDMS/IZipG10F_Side2/";
+        String iname = "G10F_Side2-";
+        String oname = "IZipG10F_Side2-";
+        String itype = "BMP";
+        String otype = "png";
+
+        int first = 1;
+        int last = 8585;
+
+        for (int inum = first; inum <= last; inum++) {
+            BufferedImage image = ImageIO.read(new File(idir+iname+inum+"."+itype));
+            if (inum % 100 == 0) System.out.println("Processing file "+inum);
+
+            int onum = inum - first + 1;
+            File outfile = new File(odir+oname+inum+"."+otype);
+
+            ImageIO.write(image, otype, outfile);
+        }
+    }
+
+    private BufferedImage rotate(BufferedImage image) {
+
+        int width = image.getWidth();
+        int height = image.getHeight();
+        BufferedImage rotated = new BufferedImage(width, height, image.getType());
+        for (int row = 0; row < height; row++) {
+            for (int col = 0; col < width; col++) {
+                int pixel = image.getRGB(col, row);
+                rotated.setRGB(width - col - 1, height - row - 1, pixel);
+            }
+        }
+        return rotated;
+    }
+}

CDMS/src/CDMS/Partridge/ImageNavigatorI
ImageNavigator.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ImageNavigator.java	11 Oct 2010 00:25:44 -0000	1.1
+++ ImageNavigator.java	9 Dec 2010 19:14:36 -0000	1.2
@@ -72,13 +72,18 @@
 //        process("f:/CDMS/IZipG47_Side2_PKG/Autorun_IZipG47_Side2_PKG_10Aug2010.txt",
 //                "c:/CDMS/IZipG47_Side2_PKG/", "IZipG47_Side2_PKG-", 1, "IZip G47 Side 2 Packaged",
 //                "10 August 2010");    }
-        process("c:/CDMS/IZipG16K_Side1/Autorun_IZipG16K_Side1_7Sep2010.txt",
-                "c:/CDMS/IZipG16K_Side1/", "IZipG16K_Side1-", 1, "IZip G16K Side 1",
-                "7 September 2010");
-        process("c:/CDMS/IZipG16K_Side2/Autorun_IZipG16K_Side2_7Sep2010.txt",
-                "c:/CDMS/IZipG16K_Side2/", "IZipG16K_Side2-", 1, "IZip G16K Side 2",
-                "7 September 2010");    }
-
+//        process("c:/CDMS/IZipG16K_Side1/Autorun_IZipG16K_Side1_7Sep2010.txt",
+//                "c:/CDMS/IZipG16K_Side1/", "IZipG16K_Side1-", 1, "IZip G16K Side 1",
+//                "7 September 2010");
+//        process("c:/CDMS/IZipG16K_Side2/Autorun_IZipG16K_Side2_7Sep2010.txt",
+//                "c:/CDMS/IZipG16K_Side2/", "IZipG16K_Side2-", 1, "IZip G16K Side 2",
+//                "7 September 2010");    }
+        process("c:/CDMS/IZipG10F_Side1/Autorun_IZipG10F_Side1_3Dec2010.txt",
+                "c:/CDMS/IZipG10F_Side1/", "IZipG10F_Side1-", 1, "IZip G10F Side 1",
+                "3 December 2010");
+        process("c:/CDMS/IZipG10F_Side2/Autorun_IZipG10F_Side2_6Dec2010.txt",
+                "c:/CDMS/IZipG10F_Side2/", "IZipG10F_Side2-", 1, "IZip G10F Side 2",
+                "6 December 2010");    }
     /**
      *
      * @param autorunfile name of autorun file used to acquire images
CVSspam 0.2.8