commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r995859 [1/30] - in /commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan: ./ color/ common/ common/byteSources/ common/mylzw/ formats/bmp/ formats/bmp/pixelparsers/ formats/bmp/writers/ formats/gif/ formats/ico/ formats/jpeg/ fo...
Date Fri, 10 Sep 2010 16:33:42 GMT
Author: sebb
Date: Fri Sep 10 16:33:35 2010
New Revision: 995859

URL: http://svn.apache.org/viewvc?rev=995859&view=rev
Log:
Tab police

Modified:
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ColorTools.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/FormatCompliance.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageDump.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageFormat.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageReadException.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageWriteException.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/Sanselan.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/SanselanConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/SanselanException.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/color/ColorConversions.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/color/ColorHSL.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/color/ColorHSV.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/color/ColorHunterLab.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/color/ColorXYZ.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/BinaryConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/BinaryFileFunctions.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/BinaryFileParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/BinaryInputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/BinaryOutputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/BitInputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/BitInputStreamFlexible.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/Compression.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/IBufferedImageFactory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/IImageMetadata.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/ImageMetadata.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/MyByteArrayOutputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/RationalNumber.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/RationalNumberUtilities.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/RgbBufferedImageFactory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/SimpleBufferedImageFactory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/ZLibUtils.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/byteSources/ByteSource.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/byteSources/ByteSourceArray.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/byteSources/ByteSourceFile.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/byteSources/ByteSourceInputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/mylzw/BitsToByteInputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/mylzw/MyBitInputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/mylzw/MyBitOutputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/mylzw/MyLZWCompressor.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/common/mylzw/MyLZWDecompressor.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/BmpHeaderInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/BmpImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/ImageContents.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/pixelparsers/PixelParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/pixelparsers/PixelParserBitFields.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/pixelparsers/PixelParserRgb.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/pixelparsers/PixelParserRle.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/pixelparsers/PixelParserSimple.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/writers/BMPWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/writers/BMPWriterPalette.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/bmp/writers/BMPWriterRGB.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GIFBlock.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GIFHeaderInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GenericGIFBlock.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GifImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/GraphicControlExtension.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/ImageContents.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/gif/ImageDescriptor.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/ico/IcoImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegImageMetadata.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegPhotoshopMetadata.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/JpegUtils.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/exifRewrite/ExifRewriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/IPTCBlock.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/IPTCConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/IPTCParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/IPTCRecord.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/IPTCType.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/IPTCTypeLookup.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/JpegIptcRewriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/iptc/PhotoshopApp13Data.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/APPNSegment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/App13Segment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/App2Segment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/GenericSegment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/JFIFSegment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/SOFNSegment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/SOSSegment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/Segment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/segments/UnknownSegment.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/xmp/JpegRewriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/xmp/JpegXmpParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/jpeg/xmp/JpegXmpRewriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/BitParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/GammaCorrection.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngCrc.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngImageInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngText.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/PngWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/ScanExpediter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/ScanExpediterInterlaced.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/ScanExpediterSimple.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunk.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkIDAT.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkIHDR.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkPLTE.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkgAMA.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkiCCP.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkiTXt.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkpHYs.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunktEXt.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGChunkzTXt.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/chunks/PNGTextChunk.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/scanlinefilters/ScanlineFilter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/scanlinefilters/ScanlineFilterAverage.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/scanlinefilters/ScanlineFilterNone.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/scanlinefilters/ScanlineFilterPaeth.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/scanlinefilters/ScanlineFilterSub.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/png/scanlinefilters/ScanlineFilterUp.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/FileInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PBMFileInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PBMWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PGMFileInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PGMWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PNMWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PPMFileInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/PPMWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/pnm/WhiteSpaceReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/ImageContents.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/ImageResourceBlock.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/ImageResourceType.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PSDConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PSDHeaderInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/PsdImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParserBitmap.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParserCMYK.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParserGrayscale.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParserIndexed.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParserLab.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParserRGB.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/dataparsers/DataParserStub.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/datareaders/CompressedDataReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/datareaders/DataReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/psd/datareaders/UncompressedDataReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tga/TgaImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/JpegImageData.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffContents.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffDirectory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffElement.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffField.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffHeader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffImageData.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffImageMetadata.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/TiffReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/AllTagConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/ExifTagConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/GPSTagConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/TagConstantsUtils.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/TagInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/TiffConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/TiffDirectoryConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/TiffFieldTypeConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/constants/TiffTagConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/datareaders/DataReader.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/datareaders/DataReaderStrips.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/datareaders/DataReaderTiled.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldType.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeASCII.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeByte.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeDouble.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeFloat.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeLong.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeRational.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeShort.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/fieldtypes/FieldTypeUnknown.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreterBiLevel.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreterCIELAB.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreterCMYK.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreterLogLUV.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreterPalette.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreterRGB.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/photometricinterpreters/PhotometricInterpreterYCbCr.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/ImageDataOffsets.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffImageWriterBase.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffImageWriterLossless.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffImageWriterLossy.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffOutputDirectory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffOutputField.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffOutputItem.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffOutputSet.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/tiff/write/TiffOutputSummary.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/transparencyfilters/TransparencyFilter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/transparencyfilters/TransparencyFilterGrayscale.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/transparencyfilters/TransparencyFilterIndexedColor.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/formats/transparencyfilters/TransparencyFilterTrueColor.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/icc/IccConstants.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/icc/IccProfileInfo.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/icc/IccProfileParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/icc/IccTag.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/icc/IccTagDataType.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/icc/IccTagType.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/palette/ColorSpaceSubset.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/palette/MedianCutQuantizer.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/palette/Palette.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/palette/PaletteFactory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/palette/QuantizedPalette.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/palette/SimplePalette.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/CachingInputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/CachingOutputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/Debug.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/DebugInputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/DebugOutputStream.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/IOUtils.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/ParamMap.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/util/UnicodeUtils.java

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ColorTools.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ColorTools.java?rev=995859&r1=995858&r2=995859&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ColorTools.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ColorTools.java Fri Sep 10 16:33:35 2010
@@ -35,223 +35,223 @@ import java.io.IOException;
  */
 public class ColorTools {
 
-	public BufferedImage correctImage(BufferedImage src, File file)
-			throws ImageReadException, IOException {
-		ICC_Profile icc = Sanselan.getICCProfile(file);
-		if (icc == null)
-			return src;
-
-		ICC_ColorSpace cs = new ICC_ColorSpace(icc);
-
-		BufferedImage dst = convertFromColorSpace(src, cs);
-		return dst;
-	}
-
-	public BufferedImage relabelColorSpace(BufferedImage bi, ICC_Profile profile)
-			throws ImagingOpException {
-		ICC_ColorSpace cs = new ICC_ColorSpace(profile);
-
-		return relabelColorSpace(bi, cs);
-	}
-
-	public BufferedImage relabelColorSpace(BufferedImage bi, ColorSpace cs)
-			throws ImagingOpException {
-		// This does not do the conversion. It tries to relabel the
-		// BufferedImage
-		// with its actual (presumably correct) Colorspace.
-		// use this when the image is mislabeled, presumably having been
-		// wrongly assumed to be sRGB
-
-		ColorModel cm = deriveColorModel(bi, cs);
-
-		return relabelColorSpace(bi, cm);
-
-	}
-
-	public BufferedImage relabelColorSpace(BufferedImage bi, ColorModel cm)
-			throws ImagingOpException {
-		// This does not do the conversion. It tries to relabel the
-		// BufferedImage
-		// with its actual (presumably correct) Colorspace.
-		// use this when the image is mislabeled, presumably having been
-		// wrongly assumed to be sRGB
-
-		BufferedImage result = new BufferedImage(cm, bi.getRaster(), false,
-				null);
-
-		return result;
-	}
-
-	public ColorModel deriveColorModel(BufferedImage bi, ColorSpace cs)
-			throws ImagingOpException {
-		// boolean hasAlpha = (bi.getAlphaRaster() != null);
-		return deriveColorModel(bi, cs, false);
-	}
-
-	public ColorModel deriveColorModel(BufferedImage bi, ColorSpace cs,
-			boolean force_no_alpha) throws ImagingOpException {
-		return deriveColorModel(bi.getColorModel(), cs, force_no_alpha);
-	}
-
-	public ColorModel deriveColorModel(ColorModel old_cm, ColorSpace cs,
-			boolean force_no_alpha) throws ImagingOpException {
-
-		if (old_cm instanceof ComponentColorModel) {
-			ComponentColorModel ccm = (ComponentColorModel) old_cm;
-			// ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
-			if (force_no_alpha)
-				return new ComponentColorModel(cs, false, false,
-						ComponentColorModel.OPAQUE, ccm.getTransferType());
-			else
-				return new ComponentColorModel(cs, ccm.hasAlpha(), ccm
-						.isAlphaPremultiplied(), ccm.getTransparency(), ccm
-						.getTransferType());
-		} else if (old_cm instanceof DirectColorModel) {
-			DirectColorModel dcm = (DirectColorModel) old_cm;
-
-			int old_mask = dcm.getRedMask() | dcm.getGreenMask()
-					| dcm.getBlueMask() | dcm.getAlphaMask();
-
-			int old_bits = count_bits_in_mask(old_mask);
-
-			return new DirectColorModel(cs, old_bits, dcm.getRedMask(), dcm
-					.getGreenMask(), dcm.getBlueMask(), dcm.getAlphaMask(), dcm
-					.isAlphaPremultiplied(), dcm.getTransferType());
-		}
-		// else if (old_cm instanceof PackedColorModel)
-		// {
-		// PackedColorModel pcm = (PackedColorModel) old_cm;
-		//
-		// // int old_mask = dcm.getRedMask() | dcm.getGreenMask()
-		// // | dcm.getBlueMask() | dcm.getAlphaMask();
-		//
-		// int old_masks[] = pcm.getMasks();
-		// // System.out.println("old_mask: " + old_mask);
-		// int old_bits = count_bits_in_mask(old_masks);
-		// // System.out.println("old_bits: " + old_bits);
-		//
-		// // PackedColorModel(ColorSpace space, int bits, int rmask, int gmask,
-		// int bmask, int amask, boolean isAlphaPremultiplied, int trans, int
-		// transferType)
-		// cm = new PackedColorModel(cs, old_bits, pcm.getMasks(),
-		//
-		// pcm.isAlphaPremultiplied(), pcm.getTransparency(), pcm
-		// .getTransferType());
-		// }
-
-		throw new ImagingOpException("Could not clone unknown ColorModel Type.");
-	}
-
-	private int count_bits_in_mask(int i) {
-		int count = 0;
-		while (i != 0) {
-			count += (i & 1);
-			// uses the unsigned version of java's right shift operator,
-			// so that left hand bits are zeroed.
-			i >>>= 1;
-		}
-		return count;
-	}
-
-	public BufferedImage convertToColorSpace(BufferedImage bi, ColorSpace to) {
-		ColorSpace from = bi.getColorModel().getColorSpace();
-
-		RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
-				RenderingHints.VALUE_RENDER_QUALITY);
-		hints.put(RenderingHints.KEY_COLOR_RENDERING,
-				RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-		hints.put(RenderingHints.KEY_DITHERING,
-				RenderingHints.VALUE_DITHER_ENABLE);
-
-		ColorConvertOp op = new ColorConvertOp(from, to, hints);
-
-		BufferedImage result = op.filter(bi, null);
-
-		result = relabelColorSpace(result, to);
-
-		return result;
-	}
-
-	public BufferedImage convertTosRGB(BufferedImage bi) {
-		ColorSpace cs_sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB);
-
-		ColorModel srgbCM = ColorModel.getRGBdefault();
-		cs_sRGB = srgbCM.getColorSpace();
-
-		return convertToColorSpace(bi, cs_sRGB);
-	}
-
-	protected BufferedImage convertFromColorSpace(BufferedImage bi,
-			ColorSpace from) {
-		ColorSpace cs_sRGB;
-
-		ColorModel srgbCM = ColorModel.getRGBdefault();
-		cs_sRGB = srgbCM.getColorSpace();
-
-		return convertBetweenColorSpaces(bi, from, cs_sRGB);
-
-	}
-
-	public BufferedImage convertBetweenICCProfiles(BufferedImage bi,
-			ICC_Profile from, ICC_Profile to) {
-		ICC_ColorSpace cs_from = new ICC_ColorSpace(from);
-		ICC_ColorSpace cs_to = new ICC_ColorSpace(to);
-
-		return convertBetweenColorSpaces(bi, cs_from, cs_to);
-	}
-
-	public BufferedImage convertToICCProfile(BufferedImage bi, ICC_Profile to) {
-		ICC_ColorSpace cs_to = new ICC_ColorSpace(to);
-
-		return convertToColorSpace(bi, cs_to);
-	}
-
-	public BufferedImage convertBetweenColorSpacesX2(BufferedImage bi,
-			ColorSpace from, ColorSpace to) {
-		RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
-				RenderingHints.VALUE_RENDER_QUALITY);
-		hints.put(RenderingHints.KEY_COLOR_RENDERING,
-				RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-		hints.put(RenderingHints.KEY_DITHERING,
-				RenderingHints.VALUE_DITHER_ENABLE);
-
-		// bi = relabelColorSpace(bi, cs);
-		// dumpColorSpace("\tcs_sRGB", cs_sRGB);
-		// dumpColorSpace("\tColorModel.getRGBdefaultc",
-		// ColorModel.getRGBdefault().getColorSpace());
-
-		bi = relabelColorSpace(bi, from);
-		ColorConvertOp op = new ColorConvertOp(from, to, hints);
-		bi = op.filter(bi, null);
-
-		bi = relabelColorSpace(bi, from);
-
-		bi = op.filter(bi, null);
-
-		bi = relabelColorSpace(bi, to);
-
-		return bi;
-
-	}
-
-	public BufferedImage convertBetweenColorSpaces(BufferedImage bi,
-			ColorSpace from, ColorSpace to) {
-		RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
-				RenderingHints.VALUE_RENDER_QUALITY);
-		hints.put(RenderingHints.KEY_COLOR_RENDERING,
-				RenderingHints.VALUE_COLOR_RENDER_QUALITY);
-		hints.put(RenderingHints.KEY_DITHERING,
-				RenderingHints.VALUE_DITHER_ENABLE);
-
-		ColorConvertOp op = new ColorConvertOp(from, to, hints);
+    public BufferedImage correctImage(BufferedImage src, File file)
+            throws ImageReadException, IOException {
+        ICC_Profile icc = Sanselan.getICCProfile(file);
+        if (icc == null)
+            return src;
+
+        ICC_ColorSpace cs = new ICC_ColorSpace(icc);
+
+        BufferedImage dst = convertFromColorSpace(src, cs);
+        return dst;
+    }
+
+    public BufferedImage relabelColorSpace(BufferedImage bi, ICC_Profile profile)
+            throws ImagingOpException {
+        ICC_ColorSpace cs = new ICC_ColorSpace(profile);
+
+        return relabelColorSpace(bi, cs);
+    }
+
+    public BufferedImage relabelColorSpace(BufferedImage bi, ColorSpace cs)
+            throws ImagingOpException {
+        // This does not do the conversion. It tries to relabel the
+        // BufferedImage
+        // with its actual (presumably correct) Colorspace.
+        // use this when the image is mislabeled, presumably having been
+        // wrongly assumed to be sRGB
+
+        ColorModel cm = deriveColorModel(bi, cs);
+
+        return relabelColorSpace(bi, cm);
+
+    }
+
+    public BufferedImage relabelColorSpace(BufferedImage bi, ColorModel cm)
+            throws ImagingOpException {
+        // This does not do the conversion. It tries to relabel the
+        // BufferedImage
+        // with its actual (presumably correct) Colorspace.
+        // use this when the image is mislabeled, presumably having been
+        // wrongly assumed to be sRGB
+
+        BufferedImage result = new BufferedImage(cm, bi.getRaster(), false,
+                null);
+
+        return result;
+    }
+
+    public ColorModel deriveColorModel(BufferedImage bi, ColorSpace cs)
+            throws ImagingOpException {
+        // boolean hasAlpha = (bi.getAlphaRaster() != null);
+        return deriveColorModel(bi, cs, false);
+    }
+
+    public ColorModel deriveColorModel(BufferedImage bi, ColorSpace cs,
+            boolean force_no_alpha) throws ImagingOpException {
+        return deriveColorModel(bi.getColorModel(), cs, force_no_alpha);
+    }
+
+    public ColorModel deriveColorModel(ColorModel old_cm, ColorSpace cs,
+            boolean force_no_alpha) throws ImagingOpException {
+
+        if (old_cm instanceof ComponentColorModel) {
+            ComponentColorModel ccm = (ComponentColorModel) old_cm;
+            // ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
+            if (force_no_alpha)
+                return new ComponentColorModel(cs, false, false,
+                        ComponentColorModel.OPAQUE, ccm.getTransferType());
+            else
+                return new ComponentColorModel(cs, ccm.hasAlpha(), ccm
+                        .isAlphaPremultiplied(), ccm.getTransparency(), ccm
+                        .getTransferType());
+        } else if (old_cm instanceof DirectColorModel) {
+            DirectColorModel dcm = (DirectColorModel) old_cm;
+
+            int old_mask = dcm.getRedMask() | dcm.getGreenMask()
+                    | dcm.getBlueMask() | dcm.getAlphaMask();
+
+            int old_bits = count_bits_in_mask(old_mask);
+
+            return new DirectColorModel(cs, old_bits, dcm.getRedMask(), dcm
+                    .getGreenMask(), dcm.getBlueMask(), dcm.getAlphaMask(), dcm
+                    .isAlphaPremultiplied(), dcm.getTransferType());
+        }
+        // else if (old_cm instanceof PackedColorModel)
+        // {
+        // PackedColorModel pcm = (PackedColorModel) old_cm;
+        //
+        // // int old_mask = dcm.getRedMask() | dcm.getGreenMask()
+        // // | dcm.getBlueMask() | dcm.getAlphaMask();
+        //
+        // int old_masks[] = pcm.getMasks();
+        // // System.out.println("old_mask: " + old_mask);
+        // int old_bits = count_bits_in_mask(old_masks);
+        // // System.out.println("old_bits: " + old_bits);
+        //
+        // // PackedColorModel(ColorSpace space, int bits, int rmask, int gmask,
+        // int bmask, int amask, boolean isAlphaPremultiplied, int trans, int
+        // transferType)
+        // cm = new PackedColorModel(cs, old_bits, pcm.getMasks(),
+        //
+        // pcm.isAlphaPremultiplied(), pcm.getTransparency(), pcm
+        // .getTransferType());
+        // }
+
+        throw new ImagingOpException("Could not clone unknown ColorModel Type.");
+    }
+
+    private int count_bits_in_mask(int i) {
+        int count = 0;
+        while (i != 0) {
+            count += (i & 1);
+            // uses the unsigned version of java's right shift operator,
+            // so that left hand bits are zeroed.
+            i >>>= 1;
+        }
+        return count;
+    }
+
+    public BufferedImage convertToColorSpace(BufferedImage bi, ColorSpace to) {
+        ColorSpace from = bi.getColorModel().getColorSpace();
+
+        RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
+                RenderingHints.VALUE_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_COLOR_RENDERING,
+                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_DITHERING,
+                RenderingHints.VALUE_DITHER_ENABLE);
+
+        ColorConvertOp op = new ColorConvertOp(from, to, hints);
+
+        BufferedImage result = op.filter(bi, null);
+
+        result = relabelColorSpace(result, to);
+
+        return result;
+    }
+
+    public BufferedImage convertTosRGB(BufferedImage bi) {
+        ColorSpace cs_sRGB = ColorSpace.getInstance(ColorSpace.CS_sRGB);
+
+        ColorModel srgbCM = ColorModel.getRGBdefault();
+        cs_sRGB = srgbCM.getColorSpace();
+
+        return convertToColorSpace(bi, cs_sRGB);
+    }
+
+    protected BufferedImage convertFromColorSpace(BufferedImage bi,
+            ColorSpace from) {
+        ColorSpace cs_sRGB;
+
+        ColorModel srgbCM = ColorModel.getRGBdefault();
+        cs_sRGB = srgbCM.getColorSpace();
+
+        return convertBetweenColorSpaces(bi, from, cs_sRGB);
+
+    }
+
+    public BufferedImage convertBetweenICCProfiles(BufferedImage bi,
+            ICC_Profile from, ICC_Profile to) {
+        ICC_ColorSpace cs_from = new ICC_ColorSpace(from);
+        ICC_ColorSpace cs_to = new ICC_ColorSpace(to);
+
+        return convertBetweenColorSpaces(bi, cs_from, cs_to);
+    }
+
+    public BufferedImage convertToICCProfile(BufferedImage bi, ICC_Profile to) {
+        ICC_ColorSpace cs_to = new ICC_ColorSpace(to);
+
+        return convertToColorSpace(bi, cs_to);
+    }
+
+    public BufferedImage convertBetweenColorSpacesX2(BufferedImage bi,
+            ColorSpace from, ColorSpace to) {
+        RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
+                RenderingHints.VALUE_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_COLOR_RENDERING,
+                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_DITHERING,
+                RenderingHints.VALUE_DITHER_ENABLE);
+
+        // bi = relabelColorSpace(bi, cs);
+        // dumpColorSpace("\tcs_sRGB", cs_sRGB);
+        // dumpColorSpace("\tColorModel.getRGBdefaultc",
+        // ColorModel.getRGBdefault().getColorSpace());
+
+        bi = relabelColorSpace(bi, from);
+        ColorConvertOp op = new ColorConvertOp(from, to, hints);
+        bi = op.filter(bi, null);
+
+        bi = relabelColorSpace(bi, from);
+
+        bi = op.filter(bi, null);
+
+        bi = relabelColorSpace(bi, to);
+
+        return bi;
+
+    }
+
+    public BufferedImage convertBetweenColorSpaces(BufferedImage bi,
+            ColorSpace from, ColorSpace to) {
+        RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING,
+                RenderingHints.VALUE_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_COLOR_RENDERING,
+                RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+        hints.put(RenderingHints.KEY_DITHERING,
+                RenderingHints.VALUE_DITHER_ENABLE);
+
+        ColorConvertOp op = new ColorConvertOp(from, to, hints);
 
-		bi = relabelColorSpace(bi, from);
+        bi = relabelColorSpace(bi, from);
 
-		BufferedImage result = op.filter(bi, null);
+        BufferedImage result = op.filter(bi, null);
 
-		result = relabelColorSpace(result, to);
+        result = relabelColorSpace(result, to);
 
-		return result;
-	}
+        return result;
+    }
 
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/FormatCompliance.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/FormatCompliance.java?rev=995859&r1=995858&r2=995859&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/FormatCompliance.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/FormatCompliance.java Fri Sep 10 16:33:35 2010
@@ -23,145 +23,145 @@ import java.util.ArrayList;
 
 public class FormatCompliance
 {
-	private final boolean failOnError;
-	private final String description;
-	private final ArrayList comments = new ArrayList();
-
-	public FormatCompliance(String description)
-	{
-		this.description = description;
-		failOnError = false;
-	}
-
-	public FormatCompliance(String description, boolean fail_on_error)
-	{
-		this.description = description;
-		this.failOnError = fail_on_error;
-	}
-
-	public static final FormatCompliance getDefault()
-	{
-		return new FormatCompliance("ignore", false);
-	}
-
-	public void addComment(String s) throws ImageReadException
-	{
-		comments.add(s);
-		if (failOnError)
-			throw new ImageReadException(s);
-	}
-
-	public void addComment(String s, int value) throws ImageReadException
-	{
-		addComment(s + ": " + getValueDescription(value));
-	}
-
-	public String toString()
-	{
-		StringWriter sw = new StringWriter();
-		PrintWriter pw = new PrintWriter(sw);
-
-		dump(pw);
-
-		return sw.getBuffer().toString();
-	}
-
-	public void dump()
-	{
-		dump(new PrintWriter(new OutputStreamWriter(System.out)));
-	}
-
-	public void dump(PrintWriter pw)
-	{
-		pw.println("Format Compliance: " + description);
-
-		if (comments.size() == 0)
-			pw.println("\t" + "No comments.");
-		else
-		{
-			for (int i = 0; i < comments.size(); i++)
-				pw.println("\t" + (i + 1) + ": " + comments.get(i));
-		}
-		pw.println("");
-		pw.flush();
-	}
-
-	private String getValueDescription(int value)
-	{
-		return value + " (" + Integer.toHexString(value) + ")";
-	}
-
-	public boolean compare_bytes(String name, byte expected[], byte actual[])
-			throws ImageReadException
-	{
-		if (expected.length != actual.length)
-		{
-			addComment(name + ": " + "Unexpected length: (expected: "
-					+ expected.length + ", actual: " + actual.length + ")");
-			return false;
-		}
-		else
-		{
-			for (int i = 0; i < expected.length; i++)
-			{
-				//				System.out.println("expected: "
-				//							+ getValueDescription(expected[i]) + ", actual: "
-				//							+ getValueDescription(actual[i]) + ")");
-				if (expected[i] != actual[i])
-				{
-					addComment(name + ": " + "Unexpected value: (expected: "
-							+ getValueDescription(expected[i]) + ", actual: "
-							+ getValueDescription(actual[i]) + ")");
-					return false;
-				}
-			}
-		}
-
-		return true;
-	}
-
-	public boolean checkBounds(String name, int min, int max, int actual)
-			throws ImageReadException
-	{
-		if ((actual < min) || (actual > max))
-		{
-			addComment(name + ": " + "bounds check: " + min + " <= " + actual
-					+ " <= " + max + ": false");
-			return false;
-		}
-
-		return true;
-	}
-
-	public boolean compare(String name, int valid, int actual)
-			throws ImageReadException
-	{
-		return compare(name, new int[]{
-			valid,
-		}, actual);
-	}
-
-	public boolean compare(String name, int valid[], int actual)
-			throws ImageReadException
-	{
-		for (int i = 0; i < valid.length; i++)
-			if (actual == valid[i])
-				return true;
-
-		StringBuffer result = new StringBuffer();
-		result.append(name + ": " + "Unexpected value: (valid: ");
-		if (valid.length > 1)
-			result.append("{");
-		for (int i = 0; i < valid.length; i++)
-		{
-			if (i > 0)
-				result.append(", ");
-			result.append(getValueDescription(valid[i]));
-		}
-		if (valid.length > 1)
-			result.append("}");
-		result.append(", actual: " + getValueDescription(actual) + ")");
-		addComment(result.toString());
-		return false;
-	}
+    private final boolean failOnError;
+    private final String description;
+    private final ArrayList comments = new ArrayList();
+
+    public FormatCompliance(String description)
+    {
+        this.description = description;
+        failOnError = false;
+    }
+
+    public FormatCompliance(String description, boolean fail_on_error)
+    {
+        this.description = description;
+        this.failOnError = fail_on_error;
+    }
+
+    public static final FormatCompliance getDefault()
+    {
+        return new FormatCompliance("ignore", false);
+    }
+
+    public void addComment(String s) throws ImageReadException
+    {
+        comments.add(s);
+        if (failOnError)
+            throw new ImageReadException(s);
+    }
+
+    public void addComment(String s, int value) throws ImageReadException
+    {
+        addComment(s + ": " + getValueDescription(value));
+    }
+
+    public String toString()
+    {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+
+        dump(pw);
+
+        return sw.getBuffer().toString();
+    }
+
+    public void dump()
+    {
+        dump(new PrintWriter(new OutputStreamWriter(System.out)));
+    }
+
+    public void dump(PrintWriter pw)
+    {
+        pw.println("Format Compliance: " + description);
+
+        if (comments.size() == 0)
+            pw.println("\t" + "No comments.");
+        else
+        {
+            for (int i = 0; i < comments.size(); i++)
+                pw.println("\t" + (i + 1) + ": " + comments.get(i));
+        }
+        pw.println("");
+        pw.flush();
+    }
+
+    private String getValueDescription(int value)
+    {
+        return value + " (" + Integer.toHexString(value) + ")";
+    }
+
+    public boolean compare_bytes(String name, byte expected[], byte actual[])
+            throws ImageReadException
+    {
+        if (expected.length != actual.length)
+        {
+            addComment(name + ": " + "Unexpected length: (expected: "
+                    + expected.length + ", actual: " + actual.length + ")");
+            return false;
+        }
+        else
+        {
+            for (int i = 0; i < expected.length; i++)
+            {
+                //                System.out.println("expected: "
+                //                            + getValueDescription(expected[i]) + ", actual: "
+                //                            + getValueDescription(actual[i]) + ")");
+                if (expected[i] != actual[i])
+                {
+                    addComment(name + ": " + "Unexpected value: (expected: "
+                            + getValueDescription(expected[i]) + ", actual: "
+                            + getValueDescription(actual[i]) + ")");
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
+    public boolean checkBounds(String name, int min, int max, int actual)
+            throws ImageReadException
+    {
+        if ((actual < min) || (actual > max))
+        {
+            addComment(name + ": " + "bounds check: " + min + " <= " + actual
+                    + " <= " + max + ": false");
+            return false;
+        }
+
+        return true;
+    }
+
+    public boolean compare(String name, int valid, int actual)
+            throws ImageReadException
+    {
+        return compare(name, new int[]{
+            valid,
+        }, actual);
+    }
+
+    public boolean compare(String name, int valid[], int actual)
+            throws ImageReadException
+    {
+        for (int i = 0; i < valid.length; i++)
+            if (actual == valid[i])
+                return true;
+
+        StringBuffer result = new StringBuffer();
+        result.append(name + ": " + "Unexpected value: (valid: ");
+        if (valid.length > 1)
+            result.append("{");
+        for (int i = 0; i < valid.length; i++)
+        {
+            if (i > 0)
+                result.append(", ");
+            result.append(getValueDescription(valid[i]));
+        }
+        if (valid.length > 1)
+            result.append("}");
+        result.append(", actual: " + getValueDescription(actual) + ")");
+        addComment(result.toString());
+        return false;
+    }
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageDump.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageDump.java?rev=995859&r1=995858&r2=995859&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageDump.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageDump.java Fri Sep 10 16:33:35 2010
@@ -27,83 +27,83 @@ import org.apache.sanselan.icc.IccProfil
 
 public class ImageDump
 {
-	private String colorSpaceTypeToName(ColorSpace cs)
-	{
-		//		System.out.println(prefix + ": " + "type: "
-		//				+ cs.getType() );
-		switch (cs.getType())
-		{
-			case ColorSpace.TYPE_CMYK :
-				return "TYPE_CMYK";
-			case ColorSpace.TYPE_RGB :
-				return "TYPE_RGB";
-
-			case ColorSpace.CS_sRGB :
-				return "CS_sRGB";
-			case ColorSpace.CS_GRAY :
-				return "CS_GRAY";
-			case ColorSpace.CS_CIEXYZ :
-				return "CS_CIEXYZ";
-			case ColorSpace.CS_LINEAR_RGB :
-				return "CS_LINEAR_RGB";
-			case ColorSpace.CS_PYCC :
-				return "CS_PYCC";
-		}
-
-		return "unknown";
-	}
-
-	public void dumpColorSpace(String prefix, ColorSpace cs)
-			throws ImageReadException, IOException
-	{
-		System.out.println(prefix + ": " + "type: " + cs.getType() + " ("
-				+ colorSpaceTypeToName(cs) + ")");
-
-		if (!(cs instanceof ICC_ColorSpace))
-		{
-			System.out.println(prefix + ": " + "Unknown ColorSpace: "
-					+ cs.getClass().getName());
-			return;
-		}
-
-		ICC_ColorSpace fICC_ColorSpace = (ICC_ColorSpace) cs;
-		ICC_Profile fICC_Profile = fICC_ColorSpace.getProfile();
-
-		byte bytes[] = fICC_Profile.getData();
-
-		IccProfileParser parser = new IccProfileParser();
-
-		IccProfileInfo info = parser.getICCProfileInfo(bytes);
-		info.dump(prefix);
-	}
-
-	public void dump(BufferedImage src) throws ImageReadException, IOException
-	{
-		dump("", src);
-	}
-
-	public void dump(String prefix, BufferedImage src)
-			throws ImageReadException, IOException
-	{
-		System.out.println(prefix + ": " + "dump");
-		dumpColorSpace(prefix, src.getColorModel().getColorSpace());
-		dumpBIProps(prefix, src);
-	}
-
-	public void dumpBIProps(String prefix, BufferedImage src)
-	{
-		String keys[] = src.getPropertyNames();
-		if (keys == null)
-		{
-			System.out.println(prefix + ": no props");
-			return;
-		}
-		for (int i = 0; i < keys.length; i++)
-		{
-			String key = keys[i];
-			System.out.println(prefix + ": " + key + ": "
-					+ src.getProperty(key));
-		}
-	}
+    private String colorSpaceTypeToName(ColorSpace cs)
+    {
+        //        System.out.println(prefix + ": " + "type: "
+        //                + cs.getType() );
+        switch (cs.getType())
+        {
+            case ColorSpace.TYPE_CMYK :
+                return "TYPE_CMYK";
+            case ColorSpace.TYPE_RGB :
+                return "TYPE_RGB";
+
+            case ColorSpace.CS_sRGB :
+                return "CS_sRGB";
+            case ColorSpace.CS_GRAY :
+                return "CS_GRAY";
+            case ColorSpace.CS_CIEXYZ :
+                return "CS_CIEXYZ";
+            case ColorSpace.CS_LINEAR_RGB :
+                return "CS_LINEAR_RGB";
+            case ColorSpace.CS_PYCC :
+                return "CS_PYCC";
+        }
+
+        return "unknown";
+    }
+
+    public void dumpColorSpace(String prefix, ColorSpace cs)
+            throws ImageReadException, IOException
+    {
+        System.out.println(prefix + ": " + "type: " + cs.getType() + " ("
+                + colorSpaceTypeToName(cs) + ")");
+
+        if (!(cs instanceof ICC_ColorSpace))
+        {
+            System.out.println(prefix + ": " + "Unknown ColorSpace: "
+                    + cs.getClass().getName());
+            return;
+        }
+
+        ICC_ColorSpace fICC_ColorSpace = (ICC_ColorSpace) cs;
+        ICC_Profile fICC_Profile = fICC_ColorSpace.getProfile();
+
+        byte bytes[] = fICC_Profile.getData();
+
+        IccProfileParser parser = new IccProfileParser();
+
+        IccProfileInfo info = parser.getICCProfileInfo(bytes);
+        info.dump(prefix);
+    }
+
+    public void dump(BufferedImage src) throws ImageReadException, IOException
+    {
+        dump("", src);
+    }
+
+    public void dump(String prefix, BufferedImage src)
+            throws ImageReadException, IOException
+    {
+        System.out.println(prefix + ": " + "dump");
+        dumpColorSpace(prefix, src.getColorModel().getColorSpace());
+        dumpBIProps(prefix, src);
+    }
+
+    public void dumpBIProps(String prefix, BufferedImage src)
+    {
+        String keys[] = src.getPropertyNames();
+        if (keys == null)
+        {
+            System.out.println(prefix + ": no props");
+            return;
+        }
+        for (int i = 0; i < keys.length; i++)
+        {
+            String key = keys[i];
+            System.out.println(prefix + ": " + key + ": "
+                    + src.getProperty(key));
+        }
+    }
 
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageFormat.java?rev=995859&r1=995858&r2=995859&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageFormat.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageFormat.java Fri Sep 10 16:33:35 2010
@@ -18,72 +18,72 @@ package org.apache.sanselan;
 
 public class ImageFormat
 {
-	public final String name;
-	public final String extension;
-	public final boolean actual;
-
-	private ImageFormat(String name, boolean actual)
-	{
-		this.name = name;
-		this.extension = name;
-		this.actual = actual;
-	}
-
-	private ImageFormat(String name)
-	{
-		this.name = name;
-		this.extension = name;
-		actual = true;
-	}
-
-	public boolean equals(Object o)
-	{
-		if (!(o instanceof ImageFormat))
-			return false;
-
-		ImageFormat other = (ImageFormat) o;
-
-		return other.name.equals(name);
-
-	}
-
-	public String toString()
-	{
-		return "{" + name + ": " + extension + "}";
-	}
-
-	public int hashCode()
-	{
-		return name.hashCode();
-	}
-
-	public static final ImageFormat IMAGE_FORMAT_UNKNOWN = new ImageFormat(
-			"UNKNOWN", false);
-	public static final ImageFormat IMAGE_FORMAT_PNG = new ImageFormat("PNG");
-	public static final ImageFormat IMAGE_FORMAT_GIF = new ImageFormat("GIF");
-	public static final ImageFormat IMAGE_FORMAT_ICO = new ImageFormat("ICO");
-	public static final ImageFormat IMAGE_FORMAT_TIFF = new ImageFormat("TIFF");
-	public static final ImageFormat IMAGE_FORMAT_JPEG = new ImageFormat("JPEG");
-	public static final ImageFormat IMAGE_FORMAT_BMP = new ImageFormat("BMP");
-	public static final ImageFormat IMAGE_FORMAT_PSD = new ImageFormat("PSD");
-	public static final ImageFormat IMAGE_FORMAT_PBM = new ImageFormat("PBM");
-	public static final ImageFormat IMAGE_FORMAT_PGM = new ImageFormat("PGM");
-	public static final ImageFormat IMAGE_FORMAT_PPM = new ImageFormat("PPM");
-	public static final ImageFormat IMAGE_FORMAT_PNM = new ImageFormat("PNM");
-	public static final ImageFormat IMAGE_FORMAT_TGA = new ImageFormat("TGA");
-	public static final ImageFormat IMAGE_FORMAT_JBIG2 = new ImageFormat("JBig2");
-
-	public static final ImageFormat[] getAllFormats()
-	{
-		ImageFormat result[] = {
-				IMAGE_FORMAT_UNKNOWN, IMAGE_FORMAT_PNG, IMAGE_FORMAT_GIF,
-				IMAGE_FORMAT_TIFF, IMAGE_FORMAT_JPEG, IMAGE_FORMAT_BMP,
-				IMAGE_FORMAT_PSD, IMAGE_FORMAT_PBM, IMAGE_FORMAT_PGM,
-				IMAGE_FORMAT_PPM, IMAGE_FORMAT_PNM, IMAGE_FORMAT_TGA,
-				IMAGE_FORMAT_JBIG2,
-		};
+    public final String name;
+    public final String extension;
+    public final boolean actual;
+
+    private ImageFormat(String name, boolean actual)
+    {
+        this.name = name;
+        this.extension = name;
+        this.actual = actual;
+    }
+
+    private ImageFormat(String name)
+    {
+        this.name = name;
+        this.extension = name;
+        actual = true;
+    }
+
+    public boolean equals(Object o)
+    {
+        if (!(o instanceof ImageFormat))
+            return false;
+
+        ImageFormat other = (ImageFormat) o;
+
+        return other.name.equals(name);
+
+    }
+
+    public String toString()
+    {
+        return "{" + name + ": " + extension + "}";
+    }
+
+    public int hashCode()
+    {
+        return name.hashCode();
+    }
+
+    public static final ImageFormat IMAGE_FORMAT_UNKNOWN = new ImageFormat(
+            "UNKNOWN", false);
+    public static final ImageFormat IMAGE_FORMAT_PNG = new ImageFormat("PNG");
+    public static final ImageFormat IMAGE_FORMAT_GIF = new ImageFormat("GIF");
+    public static final ImageFormat IMAGE_FORMAT_ICO = new ImageFormat("ICO");
+    public static final ImageFormat IMAGE_FORMAT_TIFF = new ImageFormat("TIFF");
+    public static final ImageFormat IMAGE_FORMAT_JPEG = new ImageFormat("JPEG");
+    public static final ImageFormat IMAGE_FORMAT_BMP = new ImageFormat("BMP");
+    public static final ImageFormat IMAGE_FORMAT_PSD = new ImageFormat("PSD");
+    public static final ImageFormat IMAGE_FORMAT_PBM = new ImageFormat("PBM");
+    public static final ImageFormat IMAGE_FORMAT_PGM = new ImageFormat("PGM");
+    public static final ImageFormat IMAGE_FORMAT_PPM = new ImageFormat("PPM");
+    public static final ImageFormat IMAGE_FORMAT_PNM = new ImageFormat("PNM");
+    public static final ImageFormat IMAGE_FORMAT_TGA = new ImageFormat("TGA");
+    public static final ImageFormat IMAGE_FORMAT_JBIG2 = new ImageFormat("JBig2");
+
+    public static final ImageFormat[] getAllFormats()
+    {
+        ImageFormat result[] = {
+                IMAGE_FORMAT_UNKNOWN, IMAGE_FORMAT_PNG, IMAGE_FORMAT_GIF,
+                IMAGE_FORMAT_TIFF, IMAGE_FORMAT_JPEG, IMAGE_FORMAT_BMP,
+                IMAGE_FORMAT_PSD, IMAGE_FORMAT_PBM, IMAGE_FORMAT_PGM,
+                IMAGE_FORMAT_PPM, IMAGE_FORMAT_PNM, IMAGE_FORMAT_TGA,
+                IMAGE_FORMAT_JBIG2,
+        };
 
-		return result;
-	}
+        return result;
+    }
 
 }
\ No newline at end of file

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageInfo.java?rev=995859&r1=995858&r2=995859&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageInfo.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/sanselan/ImageInfo.java Fri Sep 10 16:33:35 2010
@@ -27,348 +27,348 @@ import java.util.ArrayList;
  */
 public class ImageInfo
 {
-	private final String formatDetails; // ie version
+    private final String formatDetails; // ie version
 
-	private final int bitsPerPixel;
-	private final ArrayList comments;
+    private final int bitsPerPixel;
+    private final ArrayList comments;
 
-	private final ImageFormat format;
-	private final String formatName;
-	private final int height;
-	private final String mimeType;
-
-	private final int numberOfImages;
-	private final int physicalHeightDpi;
-	private final float physicalHeightInch;
-	private final int physicalWidthDpi;
-	private final float physicalWidthInch;
-	private final int width;
-	private final boolean isProgressive;
-	private final boolean isTransparent;
-
-	private final boolean usesPalette;
-
-	public static final int COLOR_TYPE_BW = 0;
-	public static final int COLOR_TYPE_GRAYSCALE = 1;
-	public static final int COLOR_TYPE_RGB = 2;
-	public static final int COLOR_TYPE_CMYK = 3;
-	public static final int COLOR_TYPE_OTHER = -1;
-	public static final int COLOR_TYPE_UNKNOWN = -2;
-
-	private final int colorType;
-
-	public static final String COMPRESSION_ALGORITHM_UNKNOWN = "Unknown";
-	public static final String COMPRESSION_ALGORITHM_NONE = "None";
-	public static final String COMPRESSION_ALGORITHM_LZW = "LZW";
-	public static final String COMPRESSION_ALGORITHM_PACKBITS = "PackBits";
-	public static final String COMPRESSION_ALGORITHM_JPEG = "JPEG";
-	public static final String COMPRESSION_ALGORITHM_RLE = "RLE: Run-Length Encoding";
-	public static final String COMPRESSION_ALGORITHM_PSD = "Photoshop";
-	public static final String COMPRESSION_ALGORITHM_PNG_FILTER = "PNG Filter";
-	public static final String COMPRESSION_ALGORITHM_CCITT_GROUP_3 = "CCITT Group 3 1-Dimensional Modified Huffman run-length encoding.";
-	public static final String COMPRESSION_ALGORITHM_CCITT_GROUP_4 = "CCITT Group 4";
-	public static final String COMPRESSION_ALGORITHM_CCITT_1D = "CCITT 1D";
-
-	private final String compressionAlgorithm;
-
-	public ImageInfo(String formatDetails, int bitsPerPixel,
-			ArrayList comments, ImageFormat format, String formatName,
-			int height, String mimeType, int numberOfImages,
-			int physicalHeightDpi, float physicalHeightInch,
-			int physicalWidthDpi, float physicalWidthInch, int width,
-			boolean isProgressive, boolean isTransparent, boolean usesPalette,
-			int colorType, String compressionAlgorithm)
-	{
-		this.formatDetails = formatDetails;
-
-		this.bitsPerPixel = bitsPerPixel;
-		this.comments = comments;
-
-		this.format = format;
-		this.formatName = formatName;
-		this.height = height;
-		this.mimeType = mimeType;
-
-		this.numberOfImages = numberOfImages;
-		this.physicalHeightDpi = physicalHeightDpi;
-		this.physicalHeightInch = physicalHeightInch;
-		this.physicalWidthDpi = physicalWidthDpi;
-		this.physicalWidthInch = physicalWidthInch;
-		this.width = width;
-		this.isProgressive = isProgressive;
-
-		this.isTransparent = isTransparent;
-		this.usesPalette = usesPalette;
-
-		this.colorType = colorType;
-		this.compressionAlgorithm = compressionAlgorithm;
-	}
-
-	/**
-	 * Returns the bits per pixel of the image data.
-	 */
-	public int getBitsPerPixel()
-	{
-		return bitsPerPixel;
-	}
-
-	/**
-	 * Returns a list of comments from the image file. <p/> This is mostly
-	 * obsolete.
-	 */
-	public ArrayList getComments()
-	{
-		return new ArrayList(comments);
-	}
-
-	/**
-	 * Returns the image file format, ie. ImageFormat.IMAGE_FORMAT_PNG. <p/>
-	 * Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if format is unknown.
-	 * 
-	 * @return A constant defined in ImageFormat.
-	 * @see ImageFormat
-	 */
-	public ImageFormat getFormat()
-	{
-		return format;
-	}
-
-	/**
-	 * Returns a string with the name of the image file format.
-	 * 
-	 * @see #getFormat()
-	 */
-	public String getFormatName()
-	{
-		return formatName;
-	}
-
-	/**
-	 * Returns the height of the image in pixels.
-	 * 
-	 * @see #getWidth()
-	 */
-	public int getHeight()
-	{
-		return height;
-	}
-
-	/**
-	 * Returns the MIME type of the image.
-	 * 
-	 * @see #getFormat()
-	 */
-	public String getMimeType()
-	{
-		return mimeType;
-	}
-
-	/**
-	 * Returns the number of images in the file.
-	 * <p>
-	 * Applies mostly to GIF and TIFF; reading PSD/Photoshop layers is not
-	 * supported, and Jpeg/JFIF EXIF thumbnails are not included in this count.
-	 */
-	public int getNumberOfImages()
-	{
-		return numberOfImages;
-	}
-
-	/**
-	 * Returns horizontal dpi of the image, if available.
-	 * <p>
-	 * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-	 * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-	 * 72).
-	 * 
-	 * @return returns -1 if not present.
-	 */
-	public int getPhysicalHeightDpi()
-	{
-		return physicalHeightDpi;
-	}
-
-	/**
-	 * Returns physical height of the image in inches, if available.
-	 * <p>
-	 * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-	 * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-	 * 72).
-	 * 
-	 * @return returns -1 if not present.
-	 */
-	public float getPhysicalHeightInch()
-	{
-		return physicalHeightInch;
-	}
-
-	/**
-	 * Returns vertical dpi of the image, if available.
-	 * <p>
-	 * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-	 * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-	 * 72).
-	 * 
-	 * @return returns -1 if not present.
-	 */
-	public int getPhysicalWidthDpi()
-	{
-		return physicalWidthDpi;
-	}
-
-	/**
-	 * Returns physical width of the image in inches, if available.
-	 * <p>
-	 * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
-	 * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
-	 * 72).
-	 * 
-	 * @return returns -1 if not present.
-	 */
-	public float getPhysicalWidthInch()
-	{
-		return physicalWidthInch;
-	}
-
-	/**
-	 * Returns the width of the image in pixels.
-	 * 
-	 * @see #getHeight()
-	 */
-	public int getWidth()
-	{
-		return width;
-	}
-
-	/**
-	 * Returns true if the image is progressive or interlaced.
-	 */
-	public boolean isProgressive()
-	{
-		return isProgressive;
-	}
-
-	/**
-	 * Returns the color type of the image, as a constant (ie.
-	 * ImageFormat.COLOR_TYPE_CMYK).
-	 * 
-	 * @see #getColorTypeDescription()
-	 */
-	public int getColorType()
-	{
-		return colorType;
-	}
-
-	/**
-	 * Returns a description of the color type of the image.
-	 * 
-	 * @see #getColorType()
-	 */
-	public String getColorTypeDescription()
-	{
-		switch (colorType)
-		{
-		case COLOR_TYPE_BW:
-			return "Black and White";
-		case COLOR_TYPE_GRAYSCALE:
-			return "Grayscale";
-		case COLOR_TYPE_RGB:
-			return "RGB";
-		case COLOR_TYPE_CMYK:
-			return "CMYK";
-		case COLOR_TYPE_OTHER:
-			return "Other";
-		case COLOR_TYPE_UNKNOWN:
-			return "Unknown";
-
-		default:
-			return "Unknown";
-		}
-
-	}
-
-	public void dump()
-	{
-		System.out.print(toString());
-	}
-
-	public String toString()
-	{
-		try
-		{
-			StringWriter sw = new StringWriter();
-			PrintWriter pw = new PrintWriter(sw);
-
-			toString(pw, "");
-			pw.flush();
-
-			return sw.toString();
-		} catch (Exception e)
-		{
-			return "Image Data: Error";
-		}
-	}
-
-	public void toString(PrintWriter pw, String prefix)
-			throws ImageReadException, IOException
-	{
-		pw.println("Format Details: " + formatDetails);
-
-		pw.println("Bits Per Pixel: " + bitsPerPixel);
-		pw.println("Comments: " + comments.size());
-		for (int i = 0; i < comments.size(); i++)
-		{
-			String s = (String) comments.get(i);
-			pw.println("\t" + i + ": '" + s + "'");
-
-		}
-		pw.println("Format: " + format.name);
-		pw.println("Format Name: " + formatName);
-		pw.println("Compression Algorithm: " + compressionAlgorithm);
-		pw.println("Height: " + height);
-		pw.println("MimeType: " + mimeType);
-		pw.println("Number Of Images: " + numberOfImages);
-		pw.println("Physical Height Dpi: " + physicalHeightDpi);
-		pw.println("Physical Height Inch: " + physicalHeightInch);
-		pw.println("Physical Width Dpi: " + physicalWidthDpi);
-		pw.println("Physical Width Inch: " + physicalWidthInch);
-		pw.println("Width: " + width);
-		pw.println("Is Progressive: " + isProgressive);
-		pw.println("Is Transparent: " + isTransparent);
-
-		pw.println("Color Type: " + getColorTypeDescription());
-		pw.println("Uses Palette: " + usesPalette);
-
-		pw.flush();
-
-	}
-
-	/**
-	 * Returns a description of the file format, ie. format version.
-	 */
-	public String getFormatDetails() {
-		return formatDetails;
-	}
-
-	/**
-	 * Returns true if the image has transparency.
-	 */
-	public boolean isTransparent() {
-		return isTransparent;
-	}
-
-	/**
-	 * Returns true if the image uses a palette.
-	 */
-	public boolean usesPalette() {
-		return usesPalette;
-	}
-
-	/**
-	 * Returns a description of the compression algorithm, if any.
-	 */
-	public String getCompressionAlgorithm() {
-		return compressionAlgorithm;
-	}
+    private final ImageFormat format;
+    private final String formatName;
+    private final int height;
+    private final String mimeType;
+
+    private final int numberOfImages;
+    private final int physicalHeightDpi;
+    private final float physicalHeightInch;
+    private final int physicalWidthDpi;
+    private final float physicalWidthInch;
+    private final int width;
+    private final boolean isProgressive;
+    private final boolean isTransparent;
+
+    private final boolean usesPalette;
+
+    public static final int COLOR_TYPE_BW = 0;
+    public static final int COLOR_TYPE_GRAYSCALE = 1;
+    public static final int COLOR_TYPE_RGB = 2;
+    public static final int COLOR_TYPE_CMYK = 3;
+    public static final int COLOR_TYPE_OTHER = -1;
+    public static final int COLOR_TYPE_UNKNOWN = -2;
+
+    private final int colorType;
+
+    public static final String COMPRESSION_ALGORITHM_UNKNOWN = "Unknown";
+    public static final String COMPRESSION_ALGORITHM_NONE = "None";
+    public static final String COMPRESSION_ALGORITHM_LZW = "LZW";
+    public static final String COMPRESSION_ALGORITHM_PACKBITS = "PackBits";
+    public static final String COMPRESSION_ALGORITHM_JPEG = "JPEG";
+    public static final String COMPRESSION_ALGORITHM_RLE = "RLE: Run-Length Encoding";
+    public static final String COMPRESSION_ALGORITHM_PSD = "Photoshop";
+    public static final String COMPRESSION_ALGORITHM_PNG_FILTER = "PNG Filter";
+    public static final String COMPRESSION_ALGORITHM_CCITT_GROUP_3 = "CCITT Group 3 1-Dimensional Modified Huffman run-length encoding.";
+    public static final String COMPRESSION_ALGORITHM_CCITT_GROUP_4 = "CCITT Group 4";
+    public static final String COMPRESSION_ALGORITHM_CCITT_1D = "CCITT 1D";
+
+    private final String compressionAlgorithm;
+
+    public ImageInfo(String formatDetails, int bitsPerPixel,
+            ArrayList comments, ImageFormat format, String formatName,
+            int height, String mimeType, int numberOfImages,
+            int physicalHeightDpi, float physicalHeightInch,
+            int physicalWidthDpi, float physicalWidthInch, int width,
+            boolean isProgressive, boolean isTransparent, boolean usesPalette,
+            int colorType, String compressionAlgorithm)
+    {
+        this.formatDetails = formatDetails;
+
+        this.bitsPerPixel = bitsPerPixel;
+        this.comments = comments;
+
+        this.format = format;
+        this.formatName = formatName;
+        this.height = height;
+        this.mimeType = mimeType;
+
+        this.numberOfImages = numberOfImages;
+        this.physicalHeightDpi = physicalHeightDpi;
+        this.physicalHeightInch = physicalHeightInch;
+        this.physicalWidthDpi = physicalWidthDpi;
+        this.physicalWidthInch = physicalWidthInch;
+        this.width = width;
+        this.isProgressive = isProgressive;
+
+        this.isTransparent = isTransparent;
+        this.usesPalette = usesPalette;
+
+        this.colorType = colorType;
+        this.compressionAlgorithm = compressionAlgorithm;
+    }
+
+    /**
+     * Returns the bits per pixel of the image data.
+     */
+    public int getBitsPerPixel()
+    {
+        return bitsPerPixel;
+    }
+
+    /**
+     * Returns a list of comments from the image file. <p/> This is mostly
+     * obsolete.
+     */
+    public ArrayList getComments()
+    {
+        return new ArrayList(comments);
+    }
+
+    /**
+     * Returns the image file format, ie. ImageFormat.IMAGE_FORMAT_PNG. <p/>
+     * Returns ImageFormat.IMAGE_FORMAT_UNKNOWN if format is unknown.
+     *
+     * @return A constant defined in ImageFormat.
+     * @see ImageFormat
+     */
+    public ImageFormat getFormat()
+    {
+        return format;
+    }
+
+    /**
+     * Returns a string with the name of the image file format.
+     *
+     * @see #getFormat()
+     */
+    public String getFormatName()
+    {
+        return formatName;
+    }
+
+    /**
+     * Returns the height of the image in pixels.
+     *
+     * @see #getWidth()
+     */
+    public int getHeight()
+    {
+        return height;
+    }
+
+    /**
+     * Returns the MIME type of the image.
+     *
+     * @see #getFormat()
+     */
+    public String getMimeType()
+    {
+        return mimeType;
+    }
+
+    /**
+     * Returns the number of images in the file.
+     * <p>
+     * Applies mostly to GIF and TIFF; reading PSD/Photoshop layers is not
+     * supported, and Jpeg/JFIF EXIF thumbnails are not included in this count.
+     */
+    public int getNumberOfImages()
+    {
+        return numberOfImages;
+    }
+
+    /**
+     * Returns horizontal dpi of the image, if available.
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
+     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
+     * 72).
+     *
+     * @return returns -1 if not present.
+     */
+    public int getPhysicalHeightDpi()
+    {
+        return physicalHeightDpi;
+    }
+
+    /**
+     * Returns physical height of the image in inches, if available.
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
+     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
+     * 72).
+     *
+     * @return returns -1 if not present.
+     */
+    public float getPhysicalHeightInch()
+    {
+        return physicalHeightInch;
+    }
+
+    /**
+     * Returns vertical dpi of the image, if available.
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
+     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
+     * 72).
+     *
+     * @return returns -1 if not present.
+     */
+    public int getPhysicalWidthDpi()
+    {
+        return physicalWidthDpi;
+    }
+
+    /**
+     * Returns physical width of the image in inches, if available.
+     * <p>
+     * Applies to TIFF (optional), BMP (always), GIF (constant: 72), Jpeg
+     * (optional), PNG (optional), PNM (constant: 72), PSD/Photoshop (constant:
+     * 72).
+     *
+     * @return returns -1 if not present.
+     */
+    public float getPhysicalWidthInch()
+    {
+        return physicalWidthInch;
+    }
+
+    /**
+     * Returns the width of the image in pixels.
+     *
+     * @see #getHeight()
+     */
+    public int getWidth()
+    {
+        return width;
+    }
+
+    /**
+     * Returns true if the image is progressive or interlaced.
+     */
+    public boolean isProgressive()
+    {
+        return isProgressive;
+    }
+
+    /**
+     * Returns the color type of the image, as a constant (ie.
+     * ImageFormat.COLOR_TYPE_CMYK).
+     *
+     * @see #getColorTypeDescription()
+     */
+    public int getColorType()
+    {
+        return colorType;
+    }
+
+    /**
+     * Returns a description of the color type of the image.
+     *
+     * @see #getColorType()
+     */
+    public String getColorTypeDescription()
+    {
+        switch (colorType)
+        {
+        case COLOR_TYPE_BW:
+            return "Black and White";
+        case COLOR_TYPE_GRAYSCALE:
+            return "Grayscale";
+        case COLOR_TYPE_RGB:
+            return "RGB";
+        case COLOR_TYPE_CMYK:
+            return "CMYK";
+        case COLOR_TYPE_OTHER:
+            return "Other";
+        case COLOR_TYPE_UNKNOWN:
+            return "Unknown";
+
+        default:
+            return "Unknown";
+        }
+
+    }
+
+    public void dump()
+    {
+        System.out.print(toString());
+    }
+
+    public String toString()
+    {
+        try
+        {
+            StringWriter sw = new StringWriter();
+            PrintWriter pw = new PrintWriter(sw);
+
+            toString(pw, "");
+            pw.flush();
+
+            return sw.toString();
+        } catch (Exception e)
+        {
+            return "Image Data: Error";
+        }
+    }
+
+    public void toString(PrintWriter pw, String prefix)
+            throws ImageReadException, IOException
+    {
+        pw.println("Format Details: " + formatDetails);
+
+        pw.println("Bits Per Pixel: " + bitsPerPixel);
+        pw.println("Comments: " + comments.size());
+        for (int i = 0; i < comments.size(); i++)
+        {
+            String s = (String) comments.get(i);
+            pw.println("\t" + i + ": '" + s + "'");
+
+        }
+        pw.println("Format: " + format.name);
+        pw.println("Format Name: " + formatName);
+        pw.println("Compression Algorithm: " + compressionAlgorithm);
+        pw.println("Height: " + height);
+        pw.println("MimeType: " + mimeType);
+        pw.println("Number Of Images: " + numberOfImages);
+        pw.println("Physical Height Dpi: " + physicalHeightDpi);
+        pw.println("Physical Height Inch: " + physicalHeightInch);
+        pw.println("Physical Width Dpi: " + physicalWidthDpi);
+        pw.println("Physical Width Inch: " + physicalWidthInch);
+        pw.println("Width: " + width);
+        pw.println("Is Progressive: " + isProgressive);
+        pw.println("Is Transparent: " + isTransparent);
+
+        pw.println("Color Type: " + getColorTypeDescription());
+        pw.println("Uses Palette: " + usesPalette);
+
+        pw.flush();
+
+    }
+
+    /**
+     * Returns a description of the file format, ie. format version.
+     */
+    public String getFormatDetails() {
+        return formatDetails;
+    }
+
+    /**
+     * Returns true if the image has transparency.
+     */
+    public boolean isTransparent() {
+        return isTransparent;
+    }
+
+    /**
+     * Returns true if the image uses a palette.
+     */
+    public boolean usesPalette() {
+        return usesPalette;
+    }
+
+    /**
+     * Returns a description of the compression algorithm, if any.
+     */
+    public String getCompressionAlgorithm() {
+        return compressionAlgorithm;
+    }
 
 }
\ No newline at end of file



Mime
View raw message