[10.7-RC] Skia fails on uploaded posters #2332

Closed
opened 2026-02-06 21:59:01 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @Shadowghost on GitHub (Dec 5, 2020).

Describe the bug
Uploading posters works but they're never shown because Skia errors out.

System (please complete the following information):

  • OS: Debian
  • Virtualization: Docker
  • Clients: Browser
  • Browser: Firefox
  • Jellyfin Version: 10.7-RC

To Reproduce

  1. Upload a poster for a library
  2. watch logs

Expected behavior
Properly process the uploaded picture and show it.

Logs

[ERR] [125] Emby.Server.Implementations.Dto.DtoService: Failed to determine primary image aspect ratio for /jellyfin/data/lib/root/default/Movies/folder.jpg
Non-success codec result: Unimplemented
Jellyfin.Drawing.Skia.SkiaCodecException: Exception of type 'Jellyfin.Drawing.Skia.SkiaCodecException' was thrown.
   at Jellyfin.Drawing.Skia.SkiaHelper.EnsureSuccess(SKCodecResult result)
   at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageSize(String path)
   at Emby.Drawing.ImageProcessor.GetImageDimensions(String path)
   at Emby.Drawing.ImageProcessor.GetImageDimensions(BaseItem item, ItemImageInfo info)
   at Emby.Server.Implementations.Dto.DtoService.GetPrimaryImageAspectRatio(BaseItem item)
[ERR] [130] Emby.Server.Implementations.Library.LibraryManager: Cannot get image dimensions for /jellyfin/data/lib/root/default/Movies/folder.jpg
Non-success codec result: Unimplemented
Jellyfin.Drawing.Skia.SkiaCodecException: Exception of type 'Jellyfin.Drawing.Skia.SkiaCodecException' was thrown.
   at Jellyfin.Drawing.Skia.SkiaHelper.EnsureSuccess(SKCodecResult result)
   at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageSize(String path)
   at Emby.Drawing.ImageProcessor.GetImageDimensions(String path)
   at Emby.Drawing.ImageProcessor.GetImageDimensions(BaseItem item, ItemImageInfo info)
   at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate)
[ERR] [132] Emby.Drawing.ImageProcessor: Error encoding image
System.IO.InvalidDataException: Skia unable to read image /jellyfin/data/lib/root/default/Movies/folder.jpg
   at Jellyfin.Drawing.Skia.SkiaEncoder.EncodeImage(String inputPath, DateTime dateModified, String outputPath, Boolean autoOrient, Nullable`1 orientation, Int32 quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat)
   at Emby.Drawing.ImageProcessor.ProcessImage(ImageProcessingOptions options)
Originally created by @Shadowghost on GitHub (Dec 5, 2020). **Describe the bug** Uploading posters works but they're never shown because Skia errors out. **System (please complete the following information):** - OS: Debian - Virtualization: Docker - Clients: Browser - Browser: Firefox - Jellyfin Version: 10.7-RC **To Reproduce** 1. Upload a poster for a library 2. watch logs **Expected behavior** Properly process the uploaded picture and show it. **Logs** ``` [ERR] [125] Emby.Server.Implementations.Dto.DtoService: Failed to determine primary image aspect ratio for /jellyfin/data/lib/root/default/Movies/folder.jpg Non-success codec result: Unimplemented Jellyfin.Drawing.Skia.SkiaCodecException: Exception of type 'Jellyfin.Drawing.Skia.SkiaCodecException' was thrown. at Jellyfin.Drawing.Skia.SkiaHelper.EnsureSuccess(SKCodecResult result) at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageSize(String path) at Emby.Drawing.ImageProcessor.GetImageDimensions(String path) at Emby.Drawing.ImageProcessor.GetImageDimensions(BaseItem item, ItemImageInfo info) at Emby.Server.Implementations.Dto.DtoService.GetPrimaryImageAspectRatio(BaseItem item) [ERR] [130] Emby.Server.Implementations.Library.LibraryManager: Cannot get image dimensions for /jellyfin/data/lib/root/default/Movies/folder.jpg Non-success codec result: Unimplemented Jellyfin.Drawing.Skia.SkiaCodecException: Exception of type 'Jellyfin.Drawing.Skia.SkiaCodecException' was thrown. at Jellyfin.Drawing.Skia.SkiaHelper.EnsureSuccess(SKCodecResult result) at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageSize(String path) at Emby.Drawing.ImageProcessor.GetImageDimensions(String path) at Emby.Drawing.ImageProcessor.GetImageDimensions(BaseItem item, ItemImageInfo info) at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate) [ERR] [132] Emby.Drawing.ImageProcessor: Error encoding image System.IO.InvalidDataException: Skia unable to read image /jellyfin/data/lib/root/default/Movies/folder.jpg at Jellyfin.Drawing.Skia.SkiaEncoder.EncodeImage(String inputPath, DateTime dateModified, String outputPath, Boolean autoOrient, Nullable`1 orientation, Int32 quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) at Emby.Drawing.ImageProcessor.ProcessImage(ImageProcessingOptions options) ```
OVERLORD added the bug label 2026-02-06 21:59:01 +03:00
Author
Owner

@stopforumspam commented on GitHub (Dec 15, 2020):

I see this with uploaded posters as the uploaded image is saved as poster.jpg in base64 format.

Browser Opera Version:72.0.3815.400 on Windows 10 x64

@stopforumspam commented on GitHub (Dec 15, 2020): I see this with uploaded posters as the uploaded image is saved as poster.jpg in base64 format. Browser Opera Version:72.0.3815.400 on Windows 10 x64
Author
Owner

@stopforumspam commented on GitHub (Dec 15, 2020):

[2020-12-15 16:44:44.323 +13:00] [ERR] Error encoding image
System.IO.InvalidDataException: Skia unable to read image /var/lib/jellyfin/metadata/library/31/98a79a8b789cb7a987bf9e87c/poster.jpg
   at Jellyfin.Drawing.Skia.SkiaEncoder.EncodeImage(String inputPath, DateTime dateModified, String outputPath, Boolean autoOrient, Nullable`1 orientation, Int32 quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat)
   at Emby.Drawing.ImageProcessor.ProcessImage(ImageProcessingOptions options)

# file poster.jpg 
poster.jpg: ASCII text, with very long lines, with no line terminators
# cat poster.jpg | base64 -d > j
# cp j poster.jpg 
# rm j
# file poster.jpg 
poster.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 900x1335, components 3


@stopforumspam commented on GitHub (Dec 15, 2020): ``` [2020-12-15 16:44:44.323 +13:00] [ERR] Error encoding image System.IO.InvalidDataException: Skia unable to read image /var/lib/jellyfin/metadata/library/31/98a79a8b789cb7a987bf9e87c/poster.jpg at Jellyfin.Drawing.Skia.SkiaEncoder.EncodeImage(String inputPath, DateTime dateModified, String outputPath, Boolean autoOrient, Nullable`1 orientation, Int32 quality, ImageProcessingOptions options, ImageFormat selectedOutputFormat) at Emby.Drawing.ImageProcessor.ProcessImage(ImageProcessingOptions options) # file poster.jpg poster.jpg: ASCII text, with very long lines, with no line terminators # cat poster.jpg | base64 -d > j # cp j poster.jpg # rm j # file poster.jpg poster.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 900x1335, components 3 ```
Author
Owner

@nyanmisaka commented on GitHub (Dec 15, 2020):

I see this with uploaded posters as the uploaded image is saved as poster.jpg in base64 format.

Browser Opera Version:72.0.3815.400 on Windows 10 x64

In apiclient, FileReader.readAsDataURL encoded the image as base64, while server didn't decode that before image processing.
37d982976a/src/apiClient.js (L2050)

@nyanmisaka commented on GitHub (Dec 15, 2020): > I see this with uploaded posters as the uploaded image is saved as poster.jpg in base64 format. > > Browser Opera Version:72.0.3815.400 on Windows 10 x64 In apiclient, `FileReader.readAsDataURL` encoded the image as base64, while server didn't decode that before image processing. https://github.com/jellyfin/jellyfin-apiclient-javascript/blob/37d982976acb0a6abcbc0f57bfb0ca778b9275d9/src/apiClient.js#L2050
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#2332