ThinkGeo.com    |     Documentation    |     Premium Support

Cannot upgrade SkiaSharp to latest "SkiaSharp.SKData"

Hi, following a suggestion from you on this forum I have tried upgrading the dependency SkiaSharp to the latest version (3.116.1) as the current version seems to have a bug related to adding a jpeg to a ThinkGeo map.
So my current ThinkGeo Version is 14.2.5 and I have SkiaSharpp, SkiaSharp.NativeAssets.Linux / maxOs / Win32 at 3.116.1

This required me to do an assembly binding redirect as ThinkGeo Core throws an exception otherwise.

	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<assemblyIdentity name="SkiaSharp" publicKeyToken="0738eb9f132ed756" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-3.116.0.0" newVersion="3.116.0.0" />
			</dependentAssembly>
		</assemblyBinding>
	</runtime>

After doing that however, I still cannot start the Map as I get following Error:

Exception thrown: 'System.TypeInitializationException' in SkiaSharp.dll
The type initializer for "SkiaSharp.SKData" threw an exception.
at SkiaSharp.SKData.Create(IntPtr address, Int32 length)
at SkiaSharp.SKBitmap.Decode(ReadOnlySpan`1 buffer) in / <em>/binding/SkiaSharp/SKBitmap.cs:line 573.
at SkiaSharp.SKBitmap.Decode(Byte[] buffer) in /</em> /binding/SkiaSharp/SKBitmap.cs:line 566.
at ThinkGeo.Core.EditInteractiveOverlay.e0U=()
at ThinkGeo.Core.EditInteractiveOverlay..ctor(Boolean designMode)
at ThinkGeo.Core.MapViewBase.HUQ=(Boolean designMode)
at ThinkGeo.Core.MapViewBase..ctor(Boolean designMode)
at ThinkGeo.UI.Wpf.MapView..ctor()

Inner Exception: Unable to load library ‘libSkiaSharp’.

Do you have any idea to proceed with this issue? The .dll is found, there is no binding error thrown in the fusion log etc.

Hi Julian,

It has been upgraded to the latest SkiaSharp 3.116.1 in beta105, and this will be applied to the next main release v14.3 by May. Can you use the latest beta for now and upgrade to v14.3 later?

Thanks,
Ben

Hi Ben, thank you, this works for us!

Julian, that’s great! :+1:

Hi Ben, we have just upgraded our ThinkGeo Version to the latest beta (14.3.0-beta115) to test this.

However, after this upgrade, after loading in a layer, our scrolling does not work anymore - neither through scrollwheel nor through the interface on the left. Is this a known bug?

Hi Julian,

We do find beta115 has the issue where the double-click/mouse wheel scrolling not zooming in correctly when the map is rotated. (it was correct in beta114). This issue has been fixed in today’s build beta116.

We do not see your issue though. I think beta105 is correct for you, right? can you let me know since which issue it started to have issues?

Thanks,
Ben

Hi Ben, Thanks for your response.
I was on the latest stable branch previously and it worked. I have now tried the latest beta as of today (119 Wpf, 118 Core) and I still have the same issue.
Basically, without any layers, the extent updates properly, when loading in any layer, it will not anymore.

I have changed to the beta 105 and can confirm that this works here, so this seems to be an issue with ThinkGeo. If you need any more information please tell me what I can provide so you can fix this issue in the latest beta and for the release, thanks!

Hi Julian,

I couldn’t recreate the issue, but we did make some changes regarding map extent in the latest beta (119 Core, 120 Wpf), please have a try.

If the issue still exists, I think it might have some internal exception when loading the layer which stops the map from zooming. Can you put the following 2 lines in your code and see if you can find some useful information in your output window?

        ThinkGeoDebugger.LogLevel = ThinkGeoLogLevel.Error;
        ThinkGeoDebugger.LogType = ThinkGeoLogType.All;

If still no clue, can you

  1. let me know starting from which version it started to have this issue?
  2. show me your code about the layer, how it is initialized.

Thanks,
Ben

Hi, I have updated thinkgeo to the latest beta and the scroll functionality has been restored. ThinkGeoDebugger gave me no errors. Initially it scrolled at only 1/4th the speed, but after playing with it a bit it has restored to normal speed. I didn’t change anything in the code however, that is why I wanted to mention that.
Thanks

Hi Julian,

By “it scrolled at only 1/4th the speed” I think you meant the zooming animation is 1/4 of the regular speed, right?

If you just leave the map there for a while after it has been initialized, and then do the zooming, is it still slow?

Also, can you give me some idea how big the project is, like how many overlays, how many markers or popups are on the map? It should not have any noticeable slowdown unless you have hundreds of overlays/makers.

You can set the duration of the zooming animation in the code, but it should be consistent anyway.

Thanks,
Ben

Hi Ben, sorry I was unclear, I meant that before, one tic of the scrollwheel would zoom me in 4x, and now it only zoomed in 1x if that makes sense.
I’d have to scroll 8 times to get the same zoom level as previously with only 2 scrolls.

However, I could not reproduce this issue yet, it happened after upgrading and disappeared after about an hour. Weird.

We attach meta information on each layer for our purposes, but the test setup was very small, with 2 Overlays and 1 Layer in 1 Overlay. No markers or popups, just a simple shapefile.

If it happens again I will open a thread with more debugging information, but I won’t be able to actively test this until the end of april, apologies.

Hi Julian,

No problems! If that happens again, can you also let me know:

  1. if double-click zooming in also has the same issue
  2. if the count of MapView.ZoomLevelSet.GetZoomLevels() is more than you expected.

Thanks,
Ben