KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > util > images > DummyImageInformer


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.util.images;
11
12 import java.util.Map JavaDoc;
13 import java.io.ByteArrayInputStream JavaDoc;
14
15 /**
16  * The `Dummy' ImageInformer can inform about an image without any external packages. It depends
17  * upon {@link org.mmbase.util.images.ImageInfo}
18  *
19  * @since MMBase 1.7.4
20  * @author Michiel Meeuwissen
21  * @version $Id: DummyImageInformer.java,v 1.2 2005/08/17 20:54:08 michiel Exp $
22  */

23 public class DummyImageInformer implements ImageInformer {
24
25     public void init(Map JavaDoc params) {
26     }
27
28     public Dimension getDimension(byte[] data) {
29         ImageInfo imageInfo = new ImageInfo();
30         imageInfo.setInput(new ByteArrayInputStream JavaDoc(data));
31         imageInfo.check();
32         return new Dimension(imageInfo.getWidth(), imageInfo.getHeight());
33     }
34 }
35
Popular Tags