Enhancement: Optional input file type extension to hint at best loader for Buffer/Stream
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
## Question about an existing feature
Is it possible to pass a hint to libvips to know which loader to use?
### What are you trying to achieve?
Using libvips (with libraw enabled) via Sharp to open RAW files. This works fine for most files I tested, but it fails for NEF files, which have a TIFF header. When opening a NEF file in Sharp I get a very small TIFF image (thumbnail?), not the full image.
### When you searched for similar issues, what did you find that might be related?
I suspect this could be because of the TIFF header of NEF files. I think libvips tries [to detect NEF files based on the filename](https://github.com/libvips/libvips/issues/3380), if sharp hands off a buffer or the already opened file maybe that's the reason why the file is then loaded as TIFF.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Sharp's Buffer/Stream input path and how it delegates loader detection to libvips, using the NEF/TIFF behavior described in the issue as the reproduction case. Check the referenced libvips issue for loader-detection constraints. Done should include an optional extension hint that selects the intended loader and coverage for NEF input delivered through a Buffer or Stream.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100