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

Reorder image fetching for GetImageFromClipboard to try PNG first #1344

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

StephenMcConnel
Copy link
Member

@StephenMcConnel StephenMcConnel commented Aug 28, 2024

This can help preserve transparency in copied images.


This change is Reviewable

This can help preserve transparency in copied images.
@hatton hatton enabled auto-merge August 28, 2024 20:21
Copy link

LibPalaso Tests

    35 files  ±  0     35 suites  ±0   10m 15s ⏱️ -19s
 4 824 tests ±  0  4 490 ✅ ±  0  231 💤 ± 0  103 ❌ ± 0 
10 290 runs   - 754  9 614 ✅  - 799  475 💤  - 53  201 ❌ +98 

For more details on these failures, see this check.

Results for commit 9bf7b61. ± Comparison against base commit 3fa5695.

@jasonleenaylor
Copy link
Contributor

SIL.Windows.Forms/Clipboarding/WindowsClipboard.cs line 63 at r1 (raw file):

			if (dataObject == null)
				return null;
			Exception ex = null;

Not your fault, but it looks like there is no use for this variable.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r1, all commit messages.
Reviewable status: 1 of 2 files reviewed, all discussions resolved


SIL.Windows.Forms/Clipboarding/WindowsClipboard.cs line 81 at r1 (raw file):

				catch (Exception e)
				{
					ex = e;

if the variable is removed a comment here explaining that we are intentionally ignoring it and falling back to other options would be good

Copy link
Member Author

@StephenMcConnel StephenMcConnel left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @jasonleenaylor)


SIL.Windows.Forms/Clipboarding/WindowsClipboard.cs line 63 at r1 (raw file):

Previously, jasonleenaylor (Jason Naylor) wrote…

Not your fault, but it looks like there is no use for this variable.

That's not quite true. At the end of the method, if an image is not returned, and the ex variable is not null, then the method (re)throws ex instead of returning null. But that's certainly not obvious from the default snippets shown by the reviewing tool. And I'll admit it's a marginal use. But it is a use. :-)

@jasonleenaylor
Copy link
Contributor

SIL.Windows.Forms/Clipboarding/WindowsClipboard.cs line 63 at r1 (raw file):

Previously, StephenMcConnel (Steve McConnel) wrote…

That's not quite true. At the end of the method, if an image is not returned, and the ex variable is not null, then the method (re)throws ex instead of returning null. But that's certainly not obvious from the default snippets shown by the reviewing tool. And I'll admit it's a marginal use. But it is a use. :-)

Ah, I didn't expand far enough. 😄

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @StephenMcConnel)

@hatton hatton merged commit e4a1935 into master Aug 28, 2024
1 of 4 checks passed
@hatton hatton deleted the BL-13810-PreserveTransparentPasting branch August 28, 2024 21:21
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