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

Error details:System.Private.CoreLib: An item with the same key has already been added. #1892

Closed
mewoll opened this issue Apr 23, 2024 · 1 comment

Comments

@mewoll
Copy link

mewoll commented Apr 23, 2024

System information:

  • Windows OS version: Windows10
  • ImageGlass version: 9.0.10.201 (64-bit)

To Reproduce

Steps to reproduce the behavior:

  1. install ImageGlass_9.0.10.201_x64.msi
  2. open ImageGlass.exe

Actual behavior:

Unable to view picture

Expected behavior:

Screenshots:

Snipaste_2024-04-23_19-57-55
Snipaste_2024-04-23_19-53-20
Snipaste_2024-04-23_19-50-38

Additional context:

I rolled back the old version and it was working fine.

All error messages in the second picture:
Version: ImageGlass v9.0.10.201
Release code: kobe
Magick.NET: Magick.NET Q16-HDRI-OpenMP x64 netstandard21 13.5.0
WebView2 Runtime: 124.0.2478.51
OS: Microsoft Windows NT 10.0.19045.0 64-bit


Error:

An item with the same key has already been added. Key: a26cec36-234c-4950-ae16-e34aace71d0d


System.ArgumentException: An item with the same key has already been added. Key: a26cec36-234c-4950-ae16-e34aace71d0d
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at WicNet.WicImagingComponent.<>c__DisplayClass3_0.b__0(IWICImagingFactory f)
at DirectN.WICImagingFactory.WithFactory(Action1 action) at WicNet.WicImagingComponent.LoadAllComponents() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode)
--- End of stack trace from previous location ---
at System.Lazy1.CreateValue() at WicNet.WicImagingComponent.FromClsid[T](Guid clsid) at WicNet.WicBitmapSource.ConvertTo(Guid pixelFormat, WICBitmapDitherType ditherType, WicPalette palette, Double alphaThresholdPercent, WICBitmapPaletteType paletteTranslate) at D2Phap.DXHelper.ToD2D1Bitmap(IComObject1 dc, WicBitmapSource wicSrc, Nullable1 bitmapProps) at ImageGlass.Viewer.DXCanvas.SetImage(IgImgData imgData, UInt32 frameIndex, Boolean resetZoom, Boolean enableFading, Single initOpacity, Single opacityStep, Boolean isForPreview, Boolean autoAnimate, ImgTransform transforms) in D:\_GITHUB\@d2phap\ImageGlass\Source\Components \ImageGlass.Views\DXCanvas.cs:line 3024 at ImageGlass.FrmMain.ShowImagePreview(String filePath, CancellationToken token) in D:\_GITHUB\@d2phap\ImageGlass\Source\ImageGlass\FrmMain.cs:line 1282 at ImageGlass.FrmMain.HandleImageProgress_Loading(ImageLoadingEventArgs e) in D:\_GITHUB\@d2phap\ImageGlass\Source\ImageGlass\FrmMain.cs:line 1054 at ImageGlass.FrmMain.ReportToUIThread(ProgressReporterEventArgs e) in D:\_GITHUB\@d2phap\ImageGlass\Source\ImageGlass\FrmMain.cs:line 981 at System.Progress1.InvokeHandlers(Object state)
at InvokeStub_SendOrPostCallback.Invoke(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

d2phap added a commit to d2phap/WicNet that referenced this issue Apr 24, 2024
…n added

On some machines, exception thrown when there are duplicated components, caused by: `Dictionary.Add(...)`

Replace it with `_ = Dictionay.TryAdd(...)` to suspend the error.

Details: d2phap/ImageGlass#1892
@d2phap d2phap modified the milestones: v9.1, v9.0.11 Apr 27, 2024
d2phap added a commit that referenced this issue Apr 27, 2024
d2phap added a commit that referenced this issue Apr 30, 2024
@d2phap
Copy link
Owner

d2phap commented Apr 30, 2024

Duplicated #1842, should be fixed in v9.0.11!

@d2phap d2phap closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants