Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exif metadata cannot be read out for .tiff files #3074

Closed
PatrickHallek opened this issue Feb 4, 2022 · 2 comments
Closed

Exif metadata cannot be read out for .tiff files #3074

PatrickHallek opened this issue Feb 4, 2022 · 2 comments

Comments

@PatrickHallek
Copy link

PatrickHallek commented Feb 4, 2022

What are you trying todo?

I want to use the exif metadata API in order to create and read out additional metadata from a TIFF file.

What are the steps to reproduce?

await sharp({ create: { width: 1000, height: 48, channels: 3, background: '#fff' } })
        .withMetadata({ exif: { IFD0: { Copyright: 'Some Name' } } })
        .toFile('sweep.tiff')

const tiff = await sharp('sweep.tiff').metadata()
console.log(tiff.exif) // logs undefined

What is the expected behaviour?

Should log { IFD0: { Copyright: 'Some Name' } } (or a Buffer)

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

 System:
    OS: macOS 12.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 20.61 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 8.4.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
@PatrickHallek PatrickHallek changed the title Exif metadata cannot be read out Exif metadata cannot be read out for tiff files Feb 4, 2022
@PatrickHallek PatrickHallek changed the title Exif metadata cannot be read out for tiff files Exif metadata cannot be read out for .tiff files Feb 4, 2022
@PatrickHallek PatrickHallek changed the title Exif metadata cannot be read out for .tiff files Exif metadata cannot be read out for .tiff files Feb 4, 2022
@lovell
Copy link
Owner

lovell commented Feb 4, 2022

Hi, libvips doesn't currently support writing (or reading) EXIF metadata with TIFF files. My understanding is that it's somewhat more complicated than supporting EXIF in other formats as TIFF uses slightly different field names (despite EXIF as a standard originating from TIFF).

We should probably update the sharp documentation to reflect this.

@lovell
Copy link
Owner

lovell commented Apr 18, 2022

I've added a note to the docs about this via commit 4c29368 - closing as I'm not sure there's much else we can do, as this is not a simple task in either sharp or libvips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants