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

Add support for orf, arw, dng, and nef RAW image types #213

Merged
merged 7 commits into from May 22, 2019

Conversation

mceachen
Copy link
Contributor

If you're adding support for a new file type, please follow the below steps:

  • One PR per file type.

I'd love to do that, but each branch will conflict with each other, as the edits to index.js are in the same spot (between cr2 and tiff detection, due to the common 0x49 0x49 prefix). I hope this PR is banal enough to batch these together.

  • Add a fixture file named fixture.<extension> to the fixture directory.

Done. I ran truncate -s 128 on each fixture (as we only need the first 8 bytes to run the tests, and originals contained serial numbers, GPS location, and other potentially private metadata).

  • Add the file extension to the types array in test.js.

Done.

  • Add the file type detection logic to the index.js file.

Done.

  • Add the file extension to the FileType type in index.d.ts.

Done.

  • Add the file extension to the Supported file types section in the readme, in the format - [`<extension>`](URL) - Format name, for example, - [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics) - Portable Network Graphics

Done.

  • Add the file extension to the keywords array in the package.json file.

Done.

  • Run $ npm test to ensure the tests pass.

    402 tests passed

  • Open a pull request with a title like Add support for Format, for example, Add support for PNG.

  • The pull request description should include a link to the official page of the file format or some other source. Also include a link to where you found the file type detection / magic bytes and the MIME type.

The mime types agree with the output of exiftool.

readme.md Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

I hope this PR is banal enough to batch these together.

Yeah, it's fine.

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

Successfully merging this pull request may close these issues.

None yet

2 participants