-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Adds QOI support to Peek #29919
Adds QOI support to Peek #29919
Conversation
@pedrolamas |
@htcfreek from my part, this PR is ready to go! |
Thanks for opening the PR, @pedrolamas . |
No problem, thanks for letting me know, @jaimecbernardo I will try and keep the branch in sync with main branch to make sure it does not have conflicts. |
# Conflicts: # src/common/FilePreviewCommon/FilePreviewCommon.csproj
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
# Conflicts: # src/modules/peek/Peek.FilePreviewer/Previewers/MediaPreviewer/ImagePreviewer.cs
86da2e3
to
cde7c51
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.
Hi @pedrolamas ,
Thank you for the contribution!
I've tested and it seems to look good, but it seems to bring a regression:
When the preview pane is on a qoi file, you can't delete that file. This was OK in 0.76.0, it seems. Can you please look into it? I suspect the refactor caused some resources to not be freed correctly.
I've merged latest main in and added QOI to the notice section about Peek as well. Running a Dart CI test to check if it still builds OK for release. |
Thanks @jaimecbernardo, I have a feeling this is due to the fact I changed the |
@jaimecbernardo I have now fixed the problem by adding a For the record, my thinking here is that if the Disposing the |
Solves it for me. Not sure 🤔 . The other previewers don't seem to be suffering from the same issue. |
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.
LGTM! Thank you for the contribution!
Summary of the Pull Request
Adds QOI image files support to Peek!
Light theme
Dark theme
PR Checklist
Detailed Description of the Pull Request / Additional comments
A couple of notes on this PR:
QoiImage
andGcode*
classes from PreviewHandlerCommon to FilePreviewCommon, and by doing that, I had to enable<UseWindowsForms>
,<AllowUnsafeBlocks>
and<Nullable>
on the project.IFileSystemItemExtensions.GetQoiSize
is just going directly to the bytes where we expect the "width" and "height" of a QOI image to be. I did not add a file header validation, but that should be rather trivial to do as it is already implemented inQoiImage
.BitmapHelper.GetBitmapFromHBitmapAsync
has been refactored so that I could extract the code that converts aSystem.Drawing.Bitmap
to aMicrosoft.Xaml...BitmapSource
<- you might want to take a good look at this one to make sure all is ok!I understand that Peek can now show Preview Pane Handlers directly, but considering #26726, I think it best to prepare to a situation where PT stops supporting the Preview Pane Handlers completely
Validation Steps Performed
Manual validation with the test images pack in https://qoiformat.org/