Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet] Remove System.Drawing.Common as package dependency #12781

Merged
merged 11 commits into from
Nov 10, 2023

Conversation

nvborisenko
Copy link
Member

This is continuation of #12777, please review that first.

Description

I think selenium is not responsible to convert images from one format to another. It is already enough for users to deal with images in png format, even it is possible to save image as file.

If user wants to convert image, then he is able to get image as bytes and use any other 3rd-party library especially designed to work with graphics.

Motivation and Context

Continue my way to reduce package dependencies.

Types of changes

  • 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 change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@titusfortner
Copy link
Member

I think where this is coming from is that Java supports:

  • Base64
  • Bytes
  • File (stored as png)

If .NET doesn't allow saving as png in default libraries...

We can't just remove this. We can deprecate the method.
We should have a different method to return it as a Stream so a user knows they need to do something else with it.

Another option that might be nice is to move the ability to save a stream as a PNG to the support package.

@nvborisenko
Copy link
Member Author

Now all users will get a warning. And those, who are really converting image to different formats, will get exception at runtime.

@titusfortner
Copy link
Member

Please rebase on trunk and fix conflicts so I can better see what this is doing. :)

@titusfortner
Copy link
Member

those, who are really converting image to different formats, will get exception

I think we want to do this in stages. If we are removing functionality we should mark it as obsolete for a couple releases, then remove it.

@nvborisenko
Copy link
Member Author

Agree, I will prepare separate PR just to mark methods as obsolete. Keeping this one as open until we decide completely remove it.

@nvborisenko
Copy link
Member Author

I think we are ready to land it.

@titusfortner titusfortner merged commit 53874e6 into SeleniumHQ:trunk Nov 10, 2023
10 checks passed
@nvborisenko nvborisenko deleted the dotnet-dep-drawing branch November 10, 2023 12:38
@ckuetbach
Copy link

Two weeks for a breaking change in a minor release is somewhat annoying.

The Obsolete message was merged 22nd October and the breaking change was introduced Nov 10. (#12878)

@nvborisenko
Copy link
Member Author

The obsolete message shipped with v4.14 (25 Sep) and breaking change shipped with v4.16 (06 Dec). Selenium project doesn't follow semantic versioning, sorry for inconvenience.

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.

3 participants