Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

System.ArgumentException (Invalid Parameter) when switching away from a loading PPTX file

Abierto
#1,892 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
csharp
Área
desktop

Línea de trabajo

Comienza con QuickLook.Plugin.OfficeViewer.SyncfusionControl.OpenPowerpoint y sigue después la ruta de renderizado diferido hasta PdfViewerControl.ReRenderCurrentPage y PdfPageExtension.Render. Reproduce el cambio rápido con un PPTX grande y verifica que la carga anterior ya no llegue al renderizado con dimensiones cero ni produzca una System.ArgumentException no controlada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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:

  1. Select a large .pptx file (e.g., >10MB) to preview it via QuickLook.
  2. While the file is still loading/converting (before the actual preview is rendered), quickly switch to preview another file (e.g., using arrow keys).
  3. The background conversion of the initial .pptx file finishes and triggers the delayed Dispatcher.BeginInvoke rendering task.
  4. 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)
Lenguaje dominante
C#
Estrellas
25.5k
Forks
1.4k
Merge medio
14 h 38 min
PR fusionados (30 d)
1

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de QL-Win/QuickLook

Todos los issues de QL-Win/QuickLook

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.