question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Input file contains unsupported image format

See original GitHub issue

Are 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wardpeetcommented, Jan 19, 2021

@lovell okay feel free to close it, I think it comes down to update that one package 😄

0reactions
lovellcommented, Jan 19, 2021

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Input file contains unsupported image format #2003 - GitHub
Issue : when i select image let 1.jpg for the first time after restating my node server it gives me an error 'Input...
Read more >
NodeJS and Sharp, BMP to PNG Error: Input file contains ...
It seems that sharp can't handle BMP pictures. (See : https://github.com/lovell/sharp/issues/1255 ).
Read more >
Error "gatsby-plugin-manifest" Input file contains unsupported ...
I'm getting an unsupported image error when trying to deploy my Gatsby site to Netlify. The error is from the gatsby-plugin-manifest, see screenshot...
Read more >
Input file contains unsupported image format might be a race ...
Was doing some S3 work where I had fs.writeFile that worked locally but not on the server. Realized that it was causing a...
Read more >
Input file contains unsupported image format - Gatsby
We are using the plugin gatsby-source-datocms. Note that gatsby build works sometimes perfectly. This error is random, but it is happening ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found