System.ArgumentException (Invalid Parameter) when switching away from a loading PPTX file
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
Start with QuickLook.Plugin.OfficeViewer.SyncfusionControl.OpenPowerpoint, then trace the delayed rendering path into PdfViewerControl.ReRenderCurrentPage and PdfPageExtension.Render. Reproduce rapid switching with a large PPTX and verify that the previous load no longer reaches rendering with zero dimensions or produces an unhandled System.ArgumentException.
Written by the indexing model from the issue text.
Description
For all's convenience, please use English to fill this issue.
Please search within existing issues before the submission. Has this issue already been reported?
Describe the bug
The OfficeViewer plugin throws a System.ArgumentException when the user switches to a different file while a large .pptx file is still loading and converting. The exception occurs because the delayed UI rendering task attempts to execute after the viewer control has been hidden or removed, resulting in an invalid rendering dimension (width/height = 0) being passed to System.Drawing.Bitmap.
To Reproduce
Steps to reproduce the behavior:
- Select a large
.pptxfile (e.g., >10MB) to preview it via QuickLook. - While the file is still loading/converting (before the actual preview is rendered), quickly switch to preview another file (e.g., using arrow keys).
- The background conversion of the initial
.pptxfile finishes and triggers the delayedDispatcher.BeginInvokerendering task. - See error in the exception log due to invalid UI control dimensions.
Expected behavior
The plugin should gracefully handle rapid file switching. It should either cancel the background .pptx to .pdf conversion process when the user selects a different file, or add a safety check before rendering to ensure the viewer control's dimensions are valid (width > 0 and height > 0), rather than throwing an unhandled exception.
Desktop (please complete the following information):
- OS Version: Windows 11 25H2
- QuickLook Version: 4.4.0.0
Screenshots and Exception Log
QuickLook - 目标幻灯片.pptx v4.4.0.0
2026/3/15 15:00:02 Windows 10.0.26200.2
System.ArgumentException: 参数无效。
在 System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
在 PdfiumViewer.PdfDocument.Render(Int32 page, Int32 width, Int32 height, Single dpiX, Single dpiY, PdfRotation rotate, PdfRenderFlags flags, Boolean drawFormFields)
在 QuickLook.Plugin.PDFViewer.PdfPageExtension.Render(PdfDocumentWrapper doc, Int32 page, Double factor, Boolean fixDpi)
在 QuickLook.Plugin.PDFViewer.PdfViewerControl.ReRenderCurrentPage()
在 QuickLook.Plugin.PDFViewer.PdfViewerControl.UpdatePageViewWhenSelectionChanged(Object sender, SelectionChangedEventArgs e)
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
在 System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs e)
在 System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
在 System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(ItemInfo info, Boolean assumeInItemsCollection)
在 System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
在 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
在 System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
在 System.Windows.Controls.Primitives.Selector.OnItemsChanged(NotifyCollectionChangedEventArgs e)
在 System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
在 System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
在 System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
在 System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
在 System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
在 System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
在 System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
在 System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
在 QuickLook.Common.ExtensionMethods.EnumerableExtensions.ForEach[T](IEnumerable`1 enumeration, Action`1 action)
在 QuickLook.Plugin.OfficeViewer.SyncfusionControl.<>c__DisplayClass3_0.<OpenPowerpoint>b__0()
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
- Dominant language
- C#
- Stars
- 25.8k
- Forks
- 1.4k
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QL-Win/QuickLook
-
遇到超大文件会卡住Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 4 days
-
[MarkdownViewer] Mermaid classDiagram with <<annotation>> fails with "Syntax error in text"Possibly taken @suhyun-nam claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
QL-Win/QuickLook#2028 · 3 comments ·
Maintainers usually reply within 4 days
-
[Bug] If the first character entered into the search box is a space, the preview window will close.Possibly taken @MORTEM3845 claimed this 27 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 4 days
-
[Crash] Fatal CLR error (80131506) previewing any SVG when WebView2 controller creation fails — initialization failure is silently ignoredPossibly taken @Henglie claimed this 14 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
QL-Win/QuickLook#2057 · 1 comment ·
Maintainers usually reply within 4 days
All issues in QL-Win/QuickLook
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Bug IronPython Python 3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pyrevitlabs/pyRevit#4184 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
yusei36/KeePassPasskey#66 · 2 comments ·
Maintainers usually reply within 1 day
-
🐛 bug 🕒 low effort good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
guibranco/Sankhya-SDK-dotnet#654 ·
Maintainers usually reply within 1 day
-
巫女のセリフに声を付けるOpenassets claude-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Fialuxe/MouthOfGod_System#358 ·
Maintainers usually reply within 1 day