Skip to content

Add TIFF Compression when save as tiff format#108

Merged
mee-ironsoftware merged 5 commits intodevelopfrom
DW-10-iron-drawing-compression-tiff
Jun 14, 2024
Merged

Add TIFF Compression when save as tiff format#108
mee-ironsoftware merged 5 commits intodevelopfrom
DW-10-iron-drawing-compression-tiff

Conversation

@mee-ironsoftware
Copy link
Copy Markdown
Member

@mee-ironsoftware mee-ironsoftware commented Jun 12, 2024

Description

  • Use original compression when re-save from original.
  • Use LZW compression as default.

Fixes #57 and DW-10

Type of change

Please select the relevant option by placing an 'x' inside the brackets, like this: [x].

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🏗️ Internal/structural update (non-breaking change that improves code quality, organization, or performance)
  • 📚 This change requires a documentation update
  • 🚀 DevOps build chain modification for release
  • 🤖 DevOps build chain modification for CI

How Has This Been Tested?

Add unit tests to compare expected file size on both create and re-create.

Checklist:

Please run through the checklist as much as possible and mark the items completed by placing an 'x' inside the brackets, like this: [x].

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have successfully run all unit tests on Windows
  • I have successfully run all unit tests on Linux

Will use the original tiff compression if re-save.
@@ -2205,6 +2209,8 @@ private void OpenTiffToImageSharp(ReadOnlySpan<byte> bytes)
// open a TIFF stored in the stream
using (Tiff tif = Tiff.ClientOpen("in-memory", "r", tiffStream, new TiffStream()))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the other instances where it's tif as well?

Copy link
Copy Markdown
Member Author

@mee-ironsoftware mee-ironsoftware Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing this. I already change all tif in AnyBitmap to tiff.

Copy link
Copy Markdown
Contributor

@jordi-ironsoftware jordi-ironsoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@first-ironsoftware first-ironsoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mee-ironsoftware mee-ironsoftware merged commit 6a37e5d into develop Jun 14, 2024
@mee-ironsoftware mee-ironsoftware deleted the DW-10-iron-drawing-compression-tiff branch June 14, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CreateMultiFrameTiff creates Output Tiff with huge size

3 participants