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

[Issue]: Cannot get image dimensions for .../logo.svg #9619

Closed
1 task done
rgmz opened this issue Apr 8, 2023 · 1 comment
Closed
1 task done

[Issue]: Cannot get image dimensions for .../logo.svg #9619

rgmz opened this issue Apr 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@rgmz
Copy link

rgmz commented Apr 8, 2023

Please describe your bug

While reviewing the logs I noticed two distinct errors stemming from Emby.Server.Implementations.Library.LibraryManager#UpdateImagesAsync(), repeated several times (presumably every time the task runs). Both errors happen when attempting to process an .svg file. I've attached the full logs below.

The first error should be reproducible with this image:

2023-04-08 18:36:08.280 +00:00] [ERR] [18] Emby.Server.Implementations.Library.LibraryManager: Cannot get image dimensions for "/config/data/metadata/library/b1/b1468ca5910e2b4f8633becdaccea026/logo.svg"
System.FormatException: Input string was not in a correct format.

The second error should be reproducible with this image.

[2023-04-08 08:58:16.199 +00:00] [ERR] [3] Emby.Server.Implementations.Library.LibraryManager: Cannot get image dimensions for "/config/data/metadata/library/fb/fb52416928944f9abecfeeaec282ab83/logo.svg"
System.Xml.XmlException: Reference to undeclared entity 'ns_extend'. Line 13, position 16.

The issue with the second image is quite straightforward; I am not sure what the error is with the first image.

I only recently started using Jellyfin and I am not familiar with the code base, but the cause seems to be Jellyfin.Drawing.Skia.SkiaEncoder#GetImageSize and is most likely an issue with the upstream SkiaSharp.Svg library (e.g. similar issue described in luberda-molinet/FFImageLoading#1183). Regardless, I am opening the issue here to track it as these are images downloaded by Jellyfin.

Edit: Skia.Svg is apparently deprecated so this is unlikely to be resolved. The solution might be to migrate to Svg.Skia which would obviously take some effort (unless Jellyfin is already using it, but I don't think so.)

Jellyfin Version

10.8.0

if other:

10.8.9

Environment

- OS: Synology DSM 7
- Virtualization: Docker
- Clients: Browser
- Browser: Firefox
- FFmpeg Version:
- Playback Method:
- Hardware Acceleration:
- Plugins:
- Reverse Proxy:
- Base URL:
- Networking:
- Storage:

Jellyfin logs

[2023-04-08 18:35:57.920 +00:00] [INF] [18] Emby.Server.Implementations.ScheduledTasks.TaskManager: Queuing task "RefreshMediaLibraryTask"
[2023-04-08 18:35:57.922 +00:00] [INF] [18] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing "Scan Media Library"
[2023-04-08 18:35:57.922 +00:00] [INF] [18] Emby.Server.Implementations.Library.LibraryManager: Validating media library
[2023-04-08 18:36:05.307 +00:00] [ERR] [18] Emby.Server.Implementations.Library.LibraryManager: Cannot get image dimensions for "/config/data/metadata/library/fb/fb52416928944f9abecfeeaec282ab83/logo.svg"
System.Xml.XmlException: Reference to undeclared entity 'ns_extend'. Line 13, position 16.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(String name, Boolean isInAttributeValue, Boolean pushFakeEntityIfNullResolver, Int32 entityStartLinePos)
   at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
   at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
   at System.Xml.XmlTextReaderImpl.ParseAttributes()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at SkiaSharp.Extended.Svg.SKSvg.Load(Stream stream)
   at SkiaSharp.Extended.Svg.SKSvg.Load(String filename)
   at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageSize(String path)
   at Emby.Drawing.ImageProcessor.GetImageDimensions(BaseItem item, ItemImageInfo info)
   at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate)
[2023-04-08 18:36:08.280 +00:00] [ERR] [18] Emby.Server.Implementations.Library.LibraryManager: Cannot get image dimensions for "/config/data/metadata/library/b1/b1468ca5910e2b4f8633becdaccea026/logo.svg"
System.FormatException: Input string was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at SkiaSharp.Extended.Svg.ColorHelper.TryParse(String str, SKColor& color)
   at SkiaSharp.Extended.Svg.SKSvg.ReadPaints(Dictionary`2 style, SKPaint& strokePaint, SKPaint& fillPaint, Boolean isGroup)
   at SkiaSharp.Extended.Svg.SKSvg.ReadElement(XElement e, SKCanvas canvas, SKPaint stroke, SKPaint fill)
   at SkiaSharp.Extended.Svg.SKSvg.ReadElement(XElement e, SKCanvas canvas, SKPaint stroke, SKPaint fill)
   at SkiaSharp.Extended.Svg.SKSvg.LoadElements(IEnumerable`1 elements, SKCanvas canvas, SKPaint stroke, SKPaint fill)
   at SkiaSharp.Extended.Svg.SKSvg.Load(XDocument xdoc)
   at SkiaSharp.Extended.Svg.SKSvg.Load(Stream stream)
   at SkiaSharp.Extended.Svg.SKSvg.Load(String filename)
   at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageSize(String path)
   at Emby.Drawing.ImageProcessor.GetImageDimensions(BaseItem item, ItemImageInfo info)
   at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate)
[2023-04-08 18:36:08.759 +00:00] [ERR] [18] Emby.Server.Implementations.Library.LibraryManager: Cannot get image dimensions for "/config/data/metadata/library/76/769996284b493e6c813c7e44a1a5a8d7/logo.svg"
System.FormatException: Input string was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at SkiaSharp.Extended.Svg.ColorHelper.TryParse(String str, SKColor& color)
   at SkiaSharp.Extended.Svg.SKSvg.ReadPaints(Dictionary`2 style, SKPaint& strokePaint, SKPaint& fillPaint, Boolean isGroup)
   at SkiaSharp.Extended.Svg.SKSvg.ReadElement(XElement e, SKCanvas canvas, SKPaint stroke, SKPaint fill)
   at SkiaSharp.Extended.Svg.SKSvg.ReadElement(XElement e, SKCanvas canvas, SKPaint stroke, SKPaint fill)
   at SkiaSharp.Extended.Svg.SKSvg.LoadElements(IEnumerable`1 elements, SKCanvas canvas, SKPaint stroke, SKPaint fill)
   at SkiaSharp.Extended.Svg.SKSvg.Load(XDocument xdoc)
   at SkiaSharp.Extended.Svg.SKSvg.Load(Stream stream)
   at SkiaSharp.Extended.Svg.SKSvg.Load(String filename)
   at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageSize(String path)
   at Emby.Drawing.ImageProcessor.GetImageDimensions(BaseItem item, ItemImageInfo info)
   at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate)

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rgmz rgmz added the bug Something isn't working label Apr 8, 2023
@rgmz
Copy link
Author

rgmz commented Apr 9, 2023

Can't believe I missed that there was already an existing issue for this, #7626. I'll check out PR #9581 and see if that works.

@rgmz rgmz closed this as completed Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant