Skip to content

Commit

Permalink
Tiff: Change variable name to tiffCompression and change default to…
Browse files Browse the repository at this point in the history
… LZW
  • Loading branch information
mee-ironsoftware committed Jun 13, 2024
1 parent f3e6ff8 commit 2742fbe
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2287,27 +2287,25 @@ private void OpenTiffToImageSharp(ReadOnlySpan<byte> bytes)
}
}

private Compression SetTiffCompression(Tiff tif)
private void SetTiffCompression(Tiff tif)
{
Compression tifCompression = tif.GetField(TiffTag.COMPRESSION) != null && tif.GetField(TiffTag.COMPRESSION).Length > 0
Compression tiffCompression = tif.GetField(TiffTag.COMPRESSION) != null && tif.GetField(TiffTag.COMPRESSION).Length > 0
? (Compression)tif.GetField(TiffTag.COMPRESSION)[0].ToInt()
: Compression.NONE;

TiffCompression = tifCompression switch
TiffCompression = tiffCompression switch
{
Compression.CCITTRLE => TiffCompression.Ccitt1D,
Compression.CCITTFAX3 => TiffCompression.CcittGroup3Fax,
Compression.CCITTFAX4 => TiffCompression.CcittGroup4Fax,
Compression.LZW => TiffCompression.Lzw,
Compression.JPEG => TiffCompression.Jpeg,
Compression.OJPEG => TiffCompression.OldJpeg,
Compression.NEXT => TiffCompression.NeXT,
Compression.PACKBITS => TiffCompression.PackBits,
Compression.THUNDERSCAN => TiffCompression.ThunderScan,
Compression.DEFLATE => TiffCompression.Deflate,
_ => TiffCompression.Jpeg
_ => TiffCompression.Lzw
};

return tifCompression;
}

/// <summary>
Expand Down

0 comments on commit 2742fbe

Please sign in to comment.