Skip to content

Add some options with some refactoring#588

Merged
sabrogden merged 9 commits intosabrogden:masterfrom
PzaThief:fix/keep-alpha-channel
Jan 5, 2024
Merged

Add some options with some refactoring#588
sabrogden merged 9 commits intosabrogden:masterfrom
PzaThief:fix/keep-alpha-channel

Conversation

@PzaThief
Copy link
Copy Markdown
Contributor

@PzaThief PzaThief commented Jan 4, 2024

for solving #584 added some options.

  1. support PNG format as default.
  • Most programs these days support PNG natively.
  • Moreover if Ditto ignored PNG, CF_DIB is used that has many problems (Windows makes it as no alpha channel and many programs doesn't want to use it)
  1. add support all types advanced option.
  • User might want Ditto to keep all data about clipboard
  • Currently, users have to add the type every time after recognizing the missing item.
  • Because it is experimental and it will ignore supported type list in main option confusedly, default is false.
  • About GetAvailableTypes functions, there is re-check part after get available format using GetNextFormat.
  • Because GetNextFormat has a bug that not return some of formats (especially CF_DIB), it will re-check to cover include at least the standard formats. Ref
  1. in WriteImageToFile use PNG first.
  • PNG might be closer to original source. (CF_DIB is most likely lost information.)

refactoring things

  1. add Image helper to assemble image process.
  2. rename variables that makes confuse.
  3. code diet to enhance readability.
  4. remove special action about Edge. (currently Edge use chromium and it's process name is no more MicrosoftEdge.exe)

Happy new year~

@PzaThief
Copy link
Copy Markdown
Contributor Author

PzaThief commented Jan 5, 2024

I changed GetAvailableTypes function to use EnumClipboardFormats API to keep all types. (but excluded CF_MAX format because it is not valid)

@PzaThief PzaThief force-pushed the fix/keep-alpha-channel branch from 27b073a to ca4221b Compare January 5, 2024 03:37
@sabrogden sabrogden merged commit 7641c03 into sabrogden:master Jan 5, 2024
@PzaThief PzaThief deleted the fix/keep-alpha-channel branch January 6, 2024 00:23
@sabrogden
Copy link
Copy Markdown
Owner

in void CCopyThread::OnClipboardChange(CString activeWindow, CString activeWindowTitle) i don't see any reason to always call oleData.GetAvailableTypes(); it's only used if they are using a copy buffer or the new option to save all. Can we only do this when needed.

@PzaThief
Copy link
Copy Markdown
Contributor Author

PzaThief commented Jan 6, 2024

Oh, It was my miss. I'll update it together with FocusCaret fix.
Thank you!

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.

2 participants