-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Display text if an image cannot be displayed #7868
Conversation
Why can't we get the file from git and display that?
|
This specific change is "low level", it could be that the file could not be displayed as an image (like a text file renamed to .png). If there is a change, the logic to have special handling for removed images could be changed.
|
So the example was a removed image. My point is if that failed to show an
image, why can't we show the original file? Yes. If we get an imageformat
exception or whatnot then by all means show a text error message. If it is
removed, we should write to temp the file and load that. If you are going
to touch that logic then do it right. Why touch it twice.
|
It is another part of the logic, and I have several PRs to clean up that first before making such a change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
GitUI/Editor/FileViewer.cs
Outdated
if (image == null) | ||
{ | ||
ResetForText(null); | ||
internalFileViewer.SetText($"Cannot view image {fileName}", openWithDifftool); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localise please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Generally I believe translation is overkill for something like this, but I allow it as it is (at least currently) shown for removed images.
Unless there are further comments in the next two days, I will squash and schedule a merge
0ba8a7e
to
d6b8af1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little change needed. Otherwise good
d6b8af1
to
3369c0b
Compare
I updated the translation on top of #7877, still fails in master |
I think it will fail if merged before...
|
It won't until late in the day. Feel free amend my PR, and squash-merge
|
3369c0b
to
192b992
Compare
@msftbot merge in 24 hours |
Hello @gerhardol! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
Please do. There is no reason to depend on a 3rd party code here.
|
For instance removed images
192b992
to
1705600
Compare
See #7831 (comment)
Proposed changes
Display a text rather just an empty pane if the image has been removed or cannot be displayed for other reasons.
Screenshots
Before
After
Test methodology
Manual
✒️ I contribute this code under The Developer Certificate of Origin.