Skip to content

Commit

Permalink
Change ITiffHandler.SetTiffMarker to accept ushort
Browse files Browse the repository at this point in the history
This will only ever be a 16-bit value.
  • Loading branch information
don-vip committed Jul 29, 2024
1 parent 6964deb commit dec9b6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Source/com/drew/imaging/tiff/TiffHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface TiffHandler
* @param marker the 2-byte value found at position 2 of the TIFF header
* @return The TIFF standard via which to interpret the data stream.
*/
TiffStandard processTiffMarker(int marker) throws TiffProcessingException;
TiffStandard processTiffMarker(short marker) throws TiffProcessingException;

boolean tryEnterSubIfd(int tagId);
boolean hasFollowerIfd();
Expand Down
2 changes: 1 addition & 1 deletion Source/com/drew/imaging/tiff/TiffReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void processTiff(@NotNull final RandomAccessReader reader,
}

// Check the next two values for correctness.
final int tiffMarker = reader.getUInt16(2);
final short tiffMarker = (short) reader.getUInt16(2);
final TiffStandard tiffStandard = handler.processTiffMarker(tiffMarker);

boolean isBigTiff;
Expand Down
12 changes: 6 additions & 6 deletions Source/com/drew/metadata/exif/ExifTiffHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ public ExifTiffHandler(@NotNull Metadata metadata, @Nullable Directory parentDir
}

@Override
public TiffStandard processTiffMarker(int marker) throws TiffProcessingException
public TiffStandard processTiffMarker(short marker) throws TiffProcessingException
{
final int standardTiffMarker = 0x002A;
final int bigTiffMarker = 0x002B;
final int olympusRawTiffMarker = 0x4F52; // for ORF files
final int olympusRawTiffMarker2 = 0x5352; // for ORF files
final int panasonicRawTiffMarker = 0x0055; // for RW2 files
final short standardTiffMarker = 0x002A;
final short bigTiffMarker = 0x002B;
final short olympusRawTiffMarker = 0x4F52; // for ORF files
final short olympusRawTiffMarker2 = 0x5352; // for ORF files
final short panasonicRawTiffMarker = 0x0055; // for RW2 files

switch (marker) {
case standardTiffMarker:
Expand Down

0 comments on commit dec9b6b

Please sign in to comment.