-
-
Notifications
You must be signed in to change notification settings - Fork 930
Description
Describe the bug
Hi,
I've been recently getting the following error in my logs:
Error
image encoder error when running command </usr/bin/vips thumbnail_source [descriptor=0] .jpg[Q=70,strip] 640 --size down>:
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 0
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 1
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 2
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 3
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 4
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 5
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 6
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 7
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 8
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 9
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 0
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 10
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 20
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 30
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 0
(vips:580): VIPS-WARNING **: 14:47:03.419: error in tile 0 x 10
source: bad seek to 250
This used to work in the previous version and only happens to some images, after some investigation it seems the VIPS-libheif library deprecated a "partial read fallback" so is now unable to process an avif/heic file if it requires a seek() to another part of the file.
Some .avif files require to seek other parts of the file to correctly decode the image, for example:
- images with EXIF blocks at the end
- tiled HEIF images
- grid images
- HEVC chunks that reference offsets backward in the stream
It seems the problem arises because the command uses [descriptor=0] which means it's reading linearly from STDIN and cannot randomly seek the file and it fails on all the avif files that require to seek to another part of the file.
I'm definitely not qualified to make a fix in the /pkg/image/vips.go file but could someone make a fix to not tu use STDIN and instead read directly from the file or maybe create a temporary file to RAM or somewhere else so the thumbnail generation doesn't fail?
If i use the same command manually pointing to the file directly instead of using [descriptor=0] it works but I'm not sure what removing that would entail.
Steps to reproduce
- Scan a bunch of .avif photos
- If the avif picture requires a seek to another part of the file it will fail and not generate it.
Expected behaviour
The thumbnail generation should create thumbnails of the avif files and write them in jpg format
Screenshots or additional context
No response
Stash version
v0.29.3
I've attached a test SFW image that fails the thumbnail generation process
Metadata
Metadata
Assignees
Labels
Type
Projects
Status