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.

@uppy/thumbnail-generator exifr.orientation is not a function

See original GitHub issue

The error

Upon requesting a thumbnail image, the following error is thrown:

TypeError: exifr.orientation is not a function
    at ThumbnailGenerator.createThumbnail ((index):44693)
    at ThumbnailGenerator.requestThumbnail ((index):44917)

This points to this line:

    const orientationPromise = exifr.orientation(file.data).catch(_err => 1)

Related commits

fc3b50a76afdd92e00f70fddec87d3ee4e7354f4 a6bfd8123b09cd195ee6087f34b454f12b2632bc

@MikeKovarik ?

My code

thumbnailGenerator.requestThumbnail(uppyFile);

Versions

Compiled with typescript.

Broken:

@uppy/thumbnail-generator: 1.5.7
@uppy/dashboard: 1.8.0
exifr: 4.3.5

Broken:

@uppy/thumbnail-generator: 1.5.6
@uppy/dashboard: 1.7.0
exifr: 4.3.4

Working:

@uppy/thumbnail-generator: 1.5.5 (manually locked; 1.5.7 will be auto-installed)
@uppy/dashboard: 1.6.2
exifr: not installed

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
EtienneBruinescommented, Apr 3, 2020

Okay, rollup with default commonjs could not handle cjs

    // rollup.config.js
    commonjs({
      extensions: ['.js', '.cjs']
    }),
1reaction
MikeKovarikcommented, Apr 3, 2020

Hello, i was about to look into it 😄 sorry for the inconvinience.

Exifr is written as ESM and transpiled to both ESM and UMD. But since the current disarray with js/mjs/cjs and "type":"module" in package.json i decided to include each bundle (mini, lite, full) in two identical variants with both js/mjs and js/cjs extensions. So there’s dist/mini.umd.js === dist/mini.umd.cjs, dist/lite.esm.js === dist/lite.esm.mjs, etc…

In the PR I decided to go with cjs, but i didn’t expect it cause any problem since it would compile and work just fine. Anyway, I’m glad it’s fixed 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exifr NPM - npm.io
Only extracts photo's orientation. Returns object with instructions how to rotate the image: deg <number> : angle in degrees (i.e. 180 ), useful...
Read more >
Rotating an image based on exif orientation in javascript
I found this link but when I try to implement it in my web app, the image does not show up on the...
Read more >
exifr - npm
Start using exifr in your project by running `npm i exifr`. There are 56 other projects in the npm registry using exifr.
Read more >
exifr - README
This package provides a thin wrapper around ExifTool allowing the reading of image file metadata with a single command. Installation. You will need...
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