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.

GIF Regression? Error: Input file has corrupt header: gifload: Failed to read from given file

See original GitHub issue

What is the output of running npx envinfo --binaries --languages --system --utilities?

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 975.51 MB / 16.00 GB
    Shell: 3.0.2 - /usr/local/bin/fish
  Binaries:
    Node: 8.14.0 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.11.3 - /usr/local/bin/npm
  Utilities:
    CMake: 3.14.0 - /opt/local/bin/cmake
    Make: 3.81 - /usr/bin/make
    GCC: 10.14. - /usr/bin/gcc
    Git: 2.20.1 - /usr/bin/git
    Clang: 1001.0.46.4 - /usr/bin/clang
    Mercurial: 2.8.1+20131205 - /usr/local/bin/hg
    Subversion: 1.10.3 - /usr/bin/svn
    FFmpeg: 4.1.1 - /opt/local/bin/ffmpeg
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.11.4 - /usr/local/go/bin/go
    Java: 1.8.0 - /usr/bin/javac
    Perl: 5.18.4 - /usr/bin/perl
    PHP: 7.1.23 - /usr/bin/php
    Python: 2.7.10 - /usr/bin/python
    Ruby: 2.4.2 - /Users/Prescott/.rbenv/shims/ruby
    Rust: 1.13.0 - /Users/Prescott/.cargo/bin/rustup
    Scala: 2.12.2 - /usr/local/scala/bin/scalac

What are the steps to reproduce?

  1. Install sharp@0.23.0 or sharp@0.23.1
  2. Download sample image as input.gif
  3. Save below code to test.js and run node test.js
'use strict';
const fs = require('fs');
const sharp = require('sharp');
const sharpPkg = require('sharp/package.json');
const os = require('os');

const FIXTURE_PATH = 'input.gif';

const suites = [{
  label: 'with sharp(filename)',
  test: async () => {
    await sharp(FIXTURE_PATH, { failOnError: false }).metadata();
  },
}, {
  label: 'with sharp(buffer)',
  test: async () => {
    await sharp(fs.readFileSync(FIXTURE_PATH, { failOnError: false })).png().toBuffer();
  },
}];

(async () => {
  console.log('%s %s', os.platform(), os.arch());
  console.log('using sharp %s. sharp.versions: ', sharpPkg.version, sharp.versions);

  for (const suite of suites) {
    console.log('Trying %s', suite.label);

    try {
      await suite.test();
      console.log('PASSED %s', suite.label);
    } catch (e) {
      console.error('FAILED %s', suite.label);
      console.error(e);
    }
  }
})().catch(console.error);

What is the expected behaviour?

Transformation should work.

Are you able to provide a standalone code sample, without other dependencies, that demonstrates this problem?

Yes, See upper section. Also Screencast is available: https://asciinema.org/a/AZ7Z3wDn2Ro8oEcwq1pZE0gPe

Are you able to provide a sample image that helps explain the problem?

Yes. https://test-mooyoul.s3-accelerate.amazonaws.com/public/sharp-gif-regression/input.gif

for issue search results

Error: Input file has corrupt header: gifload: Failed to read from given file Error: Input buffer has corrupt header: gifload_buffer: Failed to read from given file

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mooyoulcommented, Sep 29, 2019

Oh, Thanks for the keyword. I owe you so many things 🙏I really like sharp. Thank you for making this cool software!

  • with love from Seoul
1reaction
lovellcommented, Sep 28, 2019

@mooyoul I think the Samsung firmware is misusing JPEG markers for some kind of metadata but I’ve not looked into it. There’s a lot of evidence of the problem out on the web e.g. https://www.google.com/search?q=“Invalid+SOS+parameters”+samsung

Read more comments on GitHub >

github_iconTop Results From Across the Web

Repair corrupted GIF file (free online tool)
Online tool for repairing corrupted GIF files, or files which some programs can't properly open or edit. Variety of tools for GIF repair...
Read more >
CVE's linked by advisories.oval.OR.oval
ID CVSS Last (major) update Published CVE‑2019‑16167 4.3 08‑12‑2022 ‑ 22:18 09‑09‑2019 ‑ 17:15 CVE‑2019‑20446 4.3 08‑12‑2022 ‑ 22:16 02‑02‑2020 ‑ 14:15 CVE‑2020‑28367 5.1 06‑12‑2022 ‑...
Read more >
Untitled
rename patch files - Update to 3.2.6 - Add BuildRequires: libxml2-devel, ... login user input is not shown on serial console - fix...
Read more >
CVE - Search Results - MITRE
CVE-2022-41603, The phones have the heap overflow, out-of-bounds read, and null pointer ... A crafted input file can lead to remote code execution....
Read more >
Days of Risk Report (automatically generated)
CVE RHSA Severity Public Fixed Days CVE‑2017‑5398 RHSA‑2017:0459 C 20170307 20170308 1 CVE‑2017‑5400 RHSA‑2017:0459 C 20170307 20170308 1 CVE‑2017‑5401 RHSA‑2017:0459 C 20170307 20170308 1
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