This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-imaging.git
commit b66eb5aa8bed7b075d4831c5b5d8e0a8d12c16d0 Author: Gary Gregory <[email protected]> AuthorDate: Sat Jan 3 16:27:13 2026 -0500 Javadoc --- .../org/apache/commons/imaging/common/PackBits.java | 18 ++++++++++++++++++ .../formats/tiff/constants/OceScanjobTagConstants.java | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/src/main/java/org/apache/commons/imaging/common/PackBits.java b/src/main/java/org/apache/commons/imaging/common/PackBits.java index 39cc6660..d111ff0f 100644 --- a/src/main/java/org/apache/commons/imaging/common/PackBits.java +++ b/src/main/java/org/apache/commons/imaging/common/PackBits.java @@ -22,8 +22,18 @@ import java.io.IOException; import org.apache.commons.imaging.ImagingException; import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream; +/** + * PackBits compression and decompression utilities. + */ public final class PackBits { + /** + * Compresses byte data using PackBits compression. + * + * @param bytes the bytes to compress. + * @return the compressed bytes. + * @throws IOException if an I/O error occurs. + */ public static byte[] compress(final byte[] bytes) throws IOException { // max length 1 extra byte for every 128 try (UnsynchronizedByteArrayOutputStream baos = UnsynchronizedByteArrayOutputStream.builder().setBufferSize(Allocator.checkByteArray(bytes.length * 2)) @@ -73,6 +83,14 @@ public final class PackBits { } } + /** + * Decompresses PackBits compressed data. + * + * @param bytes the compressed bytes. + * @param expected the expected number of decompressed bytes. + * @return the decompressed bytes. + * @throws ImagingException if the data is corrupt or incomplete. + */ public static byte[] decompress(final byte[] bytes, final int expected) throws ImagingException { int total = 0; diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java index 37029065..1d1a6232 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java @@ -31,18 +31,23 @@ import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoAscii; */ public final class OceScanjobTagConstants { + /** EXIF tag: Oce Scanjob Description. */ public static final TagInfoAscii EXIF_TAG_OCE_SCANJOB_DESCRIPTION = new TagInfoAscii("Oce Scanjob Description", 0xc427, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** EXIF tag: Oce Application Selector. */ public static final TagInfoAscii EXIF_TAG_OCE_APPLICATION_SELECTOR = new TagInfoAscii("Oce Application Selector", 0xc428, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** EXIF tag: Oce Identification Number. */ public static final TagInfoAscii EXIF_TAG_OCE_IDENTIFICATION_NUMBER = new TagInfoAscii("Oce Identification Number", 0xc429, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** EXIF tag: Oce ImageLogic Characteristics. */ public static final TagInfoAscii EXIF_TAG_OCE_IMAGE_LOGIC_CHARACTERISTICS = new TagInfoAscii("Oce ImageLogic Characteristics", 0xc42a, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** List of all Oce Scanjob tags. */ public static final List<TagInfo> ALL_OCE_SCANJOB_TAGS = Collections.unmodifiableList(Arrays.<TagInfo>asList(EXIF_TAG_OCE_SCANJOB_DESCRIPTION, EXIF_TAG_OCE_APPLICATION_SELECTOR, EXIF_TAG_OCE_IDENTIFICATION_NUMBER, EXIF_TAG_OCE_IMAGE_LOGIC_CHARACTERISTICS));
