Apache Sanselan is a pure Java library for reading and Writing Image formats. It has recently graduated from Incubator and is now a proud member of Apache commons proper. In previous articles, we saw how to retrieve Image metadata and information. In this post we shall see how Sanselan guesses the Image format. We shall […]
Apache Sanselan
[Apache Sanselan] Retrieving Image Metadata using Sanselan
Apache Sanselan is a pure Java library for reading and Writing Image formats. It has recently graduated from Incubator and is now a proud member of Apache commons proper. In this article we shall see how to get Image metadata using Apache Sanselan. Let’s see how the code looks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
public static void main(String[] args) { String imageFile = args[0]; try { // Metadata details IImageMetadata meta = Sanselan.getMetadata(new File(imageFile)); System.out.println("--- Image Metadata ----"); System.out.println(meta); } catch (ImageReadException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } |
Most of the work is […]
[Apache Sanselan] Retrieving Image Information using Sanselan
Apache Sanselan is a pure Java library for reading and Writing Image formats. It has recently graduated from Incubator and is now a proud member of Apache commons proper. In this article we shall see how to get Image Information using Apache Sanselan. Let’s see how the code looks
1 2 3 4 5 6 7 8 9 10 11 12 |
public static void main(String[] args) { String imageFile = args[0]; System.out.println("Image File = "+imageFile); try { ImageInfo imageInfo = Sanselan.getImageInfo(new File(imageFile)); System.out.println(imageInfo); } catch (ImageReadException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } |
Most of the work is […]