Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8169725

cannot use TIFFField(TIFFTag tag, int value) for TIFF_LONG values greater than Integer.MAX_VALUE

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs

      Description

      signature: TIFFField(TIFFTag tag, int value)

      according to docs,

           * Constructs a {@code TIFFField} with a single non-negative integral
           * value.
           * The field will have type
           * {@link TIFFTag#TIFF_SHORT TIFF_SHORT} if
           * {@code val < 65536} and type
           * {@link TIFFTag#TIFF_LONG TIFF_LONG} otherwise.

      TIFF_LONG is "32-bit (4-byte) unsigned integer" (http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf), so, e.g., 2^32 -1 is a correct value.

      but we obviously cannot set values greater than Integer.MAX_VALUE (2^31 - 1) using this constructor (NOK) (exception - negative argument).

      possible solution -- to use long type for the 2nd arg.

        Attachments

          Activity

            People

            • Assignee:
              bpb Brian Burkhalter
              Reporter:
              avstepan Alexander Stepanov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: