You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default behaviour of libvips is to cache input files, which can lead to EBUSY or EPERM errors on Windows.
Use sharp.cache(false) to switch this feature off.
Adding sharp.cache(false) does not fix this problem.
Does this problem relate to images appearing to have been rotated by 90 degrees?
Images that contain EXIF Orientation metadata are not auto-oriented. By default, EXIF metadata is removed.
To auto-orient pixel values use the parameter-less rotate() operation.
Using rotate() or keepExif() does not fix this problem.
What are the steps to reproduce?
The error occurs when calling toBuffer for a GeoTiff file. It occurred for all GeoTiff files i tried, while all other tiff files worked, so I assume that GeoTiff is the problem here.
What is the expected behaviour?
Until sharp 0.34.2, we could use sharp to create resized JPG variants of GeoTiff files. With 0.34.3 und 0.34.4, the error "Unknown error" is thrown when calling toBuffer. We run sharp in Electron, but the error also occurs when running the code below in a node script outside of Electron. I tested it on macOS 15.1 and on Windows 11.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
If you set the NODE_DEBUG=sharp environment variable you'll see this image generates lots of warnings:
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: Unknown field with tag 33550 (0x830e) encountered
SHARP 343056: Unknown field with tag 33922 (0x8482) encountered
SHARP 343056: Unknown field with tag 34735 (0x87af) encountered
SHARP 343056: Unknown field with tag 34736 (0x87b0) encountered
SHARP 343056: Unknown field with tag 34737 (0x87b1) encountered
SHARP 343056: error in tile 0 x 0
SHARP 343056: error in tile 0 x 15
If you trust the source of your input(s) and would like to ignore these warnings, use failOn:
v0.34.3 introduced upstream improvements to warning/error handling in libtiff and libvips, which have now exposed this image as one that should previously have been failing to load.
Hi @lovell, thanks for your fast and very helpful reply! Using failOn works and solves my problem for now, so I can switch back to the latest sharp version.
However, the tags listed as warnings are all tags of the GeoTIFF standard, which means that sharp fails right now for all GeoTIFF images if run with the default settings. I think it would be better to ignore warnings for these tags completely (or give an option to do that).
I see that it's a bigger problem than I thought (here's a discussion about this as well: libvips/libvips#3996). Ignoring the warnings with failOn seems to be the best approach then. I'm closing this issue, thanks again for your assistance.
I'm having the same problem when processing lots of GeoTIFFs. It's unfortunate that the only workaround seems to be to be set failOn: 'error' to every single call. Ideally sharp would not break when an image has GeoTIFF tags, like it used to do. Perhaps failOn: 'error' could become the default, so we can set failOn: 'warning' when we want it to fail. Or even have a global setting in sharp.
Ideally sharp would not break when an image has GeoTIFF tags, like it used to do.
It used to let through potentially invalid/corrupt TIFF images, whereas the current version now matches the documented default behaviour of safely failing on warnings. GeoTIFF images are not really supported by libvips (or libtiff for that matter), hence the warnings.
What I would like to do is investigate what might be possible to improve the "Unknown error" messaging as that's not very helpful on its own.
changed the title [-]Unknown error when calling toBuffer for GeoTiff file since 0.34.3[/-][+]Enhancement: improve warning/error messages from GeoTiff images (currently reports "Unknown error")[/+]on Oct 17, 2025
@lovell Yes, that would be much better as I had to a little digging to find this problem at first. Maybe it could relay the "Unknown field with tag" message, or suggest to use failOn: 'error' to suppress the warning. Thank you!
Activity
lovell commentedon Oct 15, 2025
If you set the
NODE_DEBUG=sharpenvironment variable you'll see this image generates lots of warnings:If you trust the source of your input(s) and would like to ignore these warnings, use
failOn:https://sharp.pixelplumbing.com/api-constructor/
v0.34.3 introduced upstream improvements to warning/error handling in libtiff and libvips, which have now exposed this image as one that should previously have been failing to load.
https://sharp.pixelplumbing.com/changelog/v0.34.3/
tkleinke commentedon Oct 16, 2025
Hi @lovell, thanks for your fast and very helpful reply! Using failOn works and solves my problem for now, so I can switch back to the latest sharp version.
However, the tags listed as warnings are all tags of the GeoTIFF standard, which means that sharp fails right now for all GeoTIFF images if run with the default settings. I think it would be better to ignore warnings for these tags completely (or give an option to do that).
lovell commentedon Oct 16, 2025
Please see libvips/libvips#2377
tkleinke commentedon Oct 16, 2025
I see that it's a bigger problem than I thought (here's a discussion about this as well: libvips/libvips#3996). Ignoring the warnings with failOn seems to be the best approach then. I'm closing this issue, thanks again for your assistance.
neave commentedon Oct 17, 2025
I'm having the same problem when processing lots of GeoTIFFs. It's unfortunate that the only workaround seems to be to be set
failOn: 'error'to every single call. Ideally sharp would not break when an image has GeoTIFF tags, like it used to do. PerhapsfailOn: 'error'could become the default, so we can setfailOn: 'warning'when we want it to fail. Or even have a global setting in sharp.lovell commentedon Oct 17, 2025
It used to let through potentially invalid/corrupt TIFF images, whereas the current version now matches the documented default behaviour of safely failing on warnings. GeoTIFF images are not really supported by libvips (or libtiff for that matter), hence the warnings.
What I would like to do is investigate what might be possible to improve the "Unknown error" messaging as that's not very helpful on its own.
[-]Unknown error when calling toBuffer for GeoTiff file since 0.34.3[/-][+]Enhancement: improve warning/error messages from GeoTiff images (currently reports "Unknown error")[/+]neave commentedon Oct 17, 2025
@lovell Yes, that would be much better as I had to a little digging to find this problem at first. Maybe it could relay the "Unknown field with tag" message, or suggest to use
failOn: 'error'to suppress the warning. Thank you!Improve error messaging when only warnings issued #4465
lovell commentedon Oct 17, 2025
Commit c1c16ed helps prevent the "Unknown error" message and will be part of v0.34.5.
lovell commentedon Nov 6, 2025
v0.34.5 now available.
chore(deps): update dependency sharp to ^0.35.5 (#9)