Error: Input file contains unsupported image format
See original GitHub issueAre you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?
sharp@0.27.0
What is the output of running npx envinfo --binaries --system?
System:
OS: Linux 4.19 Debian GNU/Linux 9 (stretch) 9 (stretch)
CPU: (8) x64 Intel(R) Xeon(R) CPU
Memory: 4.34 GB / 62.92 GB
Container: Yes
Shell: 4.4.12 - /bin/bash
Binaries:
Node: 12.20.1 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.10 - /usr/local/bin/npm
Hey Lovell! This is a tricky but extremely hard to reproduce issue that I’ve been trying to get to the bottom of since a few days now.
Every now and then, a call to metadata fails with the following:
Error: Input file contains unsupported image format
t1 69030128, VipsImage
vips_value_equal: no case for NULL, NULL
vips_value_equal: no case for ((VipsKernel) VIPS_KERNEL_NEAREST), ((VipsKernel) VIPS_KERNEL_NEAREST)
t2 69030128, VipsImage
generic 185, GParamObject
t1 68448192, VipsKernel
t2 68448192, VipsKernel
vips_value_equal: no case for 0.000000, 0.000000
generic 81, GParamEnum
t1 60, gdouble
t2 60, gdouble
vips_value_equal: no case for 0.000000, 0.000000
generic 109, GParamDouble
t1 60, gdouble
generic 109, GParamDouble
t2 60, gdouble
t1 69030128, VipsImage
vips_value_equal: no case for NULL, NULL
t2 69030128, VipsImage
vips_value_equal: no case for ((VipsKernel) VIPS_KERNEL_NEAREST), ((VipsKernel) VIPS_KERNEL_NEAREST)
t1 68448192, VipsKernel
t2 68448192, VipsKernel
generic 185, GParamObject
vips_value_equal: no case for 0.000000, 0.000000
t1 60, gdouble
generic 81, GParamEnum
generic 109, GParamDouble
t2 60, gdouble
generic 109, GParamDouble
t1 69030128, VipsImage
vips_value_equal: no case for 0.000000, 0.000000
t1 60, gdouble
vips_value_equal: no case for NULL, NULL
t2 60, gdouble
generic 185, GParamObject
t2 68448192, VipsKernel
t1 68448192, VipsKernel
t2 69030128, VipsImage
vips_value_equal: no case for 0.000000, 0.000000
generic 81, GParamEnum
vips_value_equal: no case for ((VipsKernel) VIPS_KERNEL_NEAREST), ((VipsKernel) VIPS_KERNEL_NEAREST)
t1 60, gdouble
t2 60, gdouble
vips_value_equal: no case for 0.000000, 0.000000
generic 109, GParamDouble
t1 60, gdouble
t2 60, gdouble
generic 109, GParamDouble
t1 69030128, VipsImage
t2 69030128, VipsImage
generic 185, GParamObject
vips_value_equal: no case for ((VipsKernel) VIPS_KERNEL_NEAREST), ((VipsKernel) VIPS_KERNEL_NEAREST)
t2 68448192, VipsKernel
t1 68448192, VipsKernel
vips_value_equal: no case for NULL, NULL
generic 81, GParamEnum
vips_value_equal: no case for 0.000000, 0.000000
t1 60, gdouble
generic 109, GParamDouble
vips_value_equal: no case for 0.000000, 0.000000
t1 60, gdouble
t2 60, gdouble
t2 60, gdouble
generic 109, GParamDouble
(sharp:23029): GLib-GObject-WARNING **: 21:07:42.309: invalid unclassed pointer in cast to 'VipsOperation'
(sharp:23029): GLib-GObject-WARNING **: 21:07:42.309: ../gobject/gsignal.c:2731: instance '0x7f899c0022e0' has no handler with id '970'
(sharp:23029): GLib-GObject-WARNING **: 21:07:42.309: ../gobject/gsignal.c:2731: instance '0x7f899c0022e0' has no handler with id '768'
(sharp:23029): GLib-GObject-WARNING **: 21:07:42.309: instance with invalid (NULL) class pointer
(sharp:23029): GLib-GObject-CRITICAL **: 21:07:42.309: g_signal_handler_disconnect: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(sharp:23029): GLib-GObject-WARNING **: 21:07:42.309: invalid unclassed pointer in cast to 'VipsObject'
(sharp:23029): GLib-GObject-CRITICAL **: 21:07:42.309: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
I can confirm that the image in question is okay and that metadata works fine on it when run independently in a test script. It seems like this only occurs under pressure when there are plenty sharp calls while processing several images in a gatsby build.
My apologies for a not so helpful issue but do you have any ideas on how I could approach fixing this?
Cheers and happy new year!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
@lovell okay feel free to close it, I think it comes down to update that one package 😄
Ah, if you’re mixing two or more “major” versions of sharp in the same Node.js process and at least one of those is prior to v0.26.0 then there can be a race condition as to which is loaded and used (v0.26.0 switched to statically-linked prebuilt binaries to fix this).