|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.content.loader.bulk.ImageLoaderFilter
public class ImageLoaderFilter
BulkLoader filter which can determine "width" and "height" metadata for GIF, JPEG, XBM, and PNG image files.
The image type is determined from the file name (based upon the
MIME type
).
This class will generally not read in the entire contents of the file. It will instead attempt to get the metadata from the image format headers. However, it does not implement full decoders for the image formats, so, there might be images files for which this doesn't work.
Constructor Summary | |
---|---|
ImageLoaderFilter()
Deprecated |
Method Summary | |
---|---|
static void |
handleGIF(File f,
Properties p,
BulkLoader loader)
Deprecated Get the metadata for a GIF file. |
static void |
handleJPEG(File f,
Properties p,
BulkLoader loader)
Deprecated Get the metadata for a JPEG file. |
static void |
handlePNG(File f,
Properties p,
BulkLoader loader)
Deprecated Get the metadata for a PNG file. |
static void |
handleXBM(File f,
Properties p,
BulkLoader loader)
Deprecated Get the metadata for a XBM file. |
void |
loadProperties(File f,
Properties p,
BulkLoader loader)
Deprecated Fill out the properties with image metadata from the specified file. |
static void |
main(String[] args)
Deprecated Print the sizes of the files specified on the command-line. |
static int |
toInt(byte b)
Deprecated Safely convert a byte to an int (with high bytes set to 0). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageLoaderFilter()
Method Detail |
---|
public void loadProperties(File f, Properties p, BulkLoader loader)
If the filename doesn't correspond to a GIF, JPEG, XBM, or PNG, it will be ignored.
loadProperties
in interface LoaderFilter
public static int toInt(byte b)
public static void handleGIF(File f, Properties p, BulkLoader loader) throws IOException
This will get "width" and "height".
This only supports standard GIF89a and GIF87a formats where the size is encoded in bytes 6-9 (i.e. after the 'GIF89a' header).
IOException
public static void handleJPEG(File f, Properties p, BulkLoader loader) throws IOException
This will get "width" and "height".
This gets the size from the Start of Frame for Baseline DCT section (designated by the 0xff 0xc0 marker).
IOException
public static void handleXBM(File f, Properties p, BulkLoader loader) throws IOException
This will get "width" and "height".
This uses a regular expression to find the width and height. It will ignore comments, although it won't ignore a width and height which are contained within a comments block.
IOException
public static void handlePNG(File f, Properties p, BulkLoader loader) throws IOException
This will get "width" and "height".
IOException
public static void main(String[] args) throws Exception
Exception
|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |