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

Improve error message when opening invalid image data from clipboard #865

Closed
fire-eggs opened this issue Sep 18, 2020 · 1 comment
Closed

Comments

@fire-eggs
Copy link
Collaborator

System information:

  • Windows OS version: Win7
  • ImageGlass version: 7.6.4.30

To Reproduce

Steps to reproduce the behavior:

  1. Copy some text into the clipboard [see additional context below].
  2. Run imageglass
  3. Open an image from the clipboard.

Actual behavior:

ImageGlass crashes.

Unhandled exception error details:

System.Exception: Base-64 file content is invalid.
   at ImageGlass.Heart.Photo.ConvertBase64ToBytes(String content)
   at ImageGlass.Heart.Photo.ConvertBase64ToBitmap(String content)
   at ImageGlass.frmMain.mnuMainOpenImageData_Click(Object sender, EventArgs e)

Expected behavior:

ImageGlass produces an error message to the effect of "clipboard does not contain image data".

Screenshots:

Additional context:

The text I happened to have in the clipboard at the time was:

System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
   at System.String.Substring(Int32 startIndex, Int32 length)
   at ImageGlass.frmMain.<mnuMainSaveAs_Click>d__133.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
@d2phap d2phap added this to the Issues 7.6.4.30 milestone Sep 25, 2020
@d2phap d2phap added this to Potential tasks in 8.0 via automation Sep 27, 2020
@d2phap d2phap moved this from Potential tasks to Tasks in 8.0 Sep 30, 2020
@d2phap d2phap changed the title Crash when opening "image" from clipboard Improve error message when opening invalid image data from clipboard Sep 30, 2020
@d2phap
Copy link
Owner

d2phap commented Oct 11, 2020

Done in the latest build of IG Moon https://imageglass.org/moon

@d2phap d2phap closed this as completed Oct 11, 2020
8.0 automation moved this from Tasks to Done Oct 11, 2020
@StevenLOL StevenLOL mentioned this issue Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
8.0
  
Done
Development

No branches or pull requests

2 participants