Add TIFF parser and buffer-based image size APIs
Introduce a TIFF parser and integrate it into the image detection/size parsing pipeline. Add buffer-based APIs (detectImageTypeFromBuffer, imageSizeFromBuffer, imageSizeFromBufferFallBack) and a helper to convert Buffer to a Readable stream; refactor parser registry into a type-to-parser map and a first-byte fast-path map for quicker detection. Harden WebP parsing with safer length checks. Add sample image resources and a comprehensive Vitest test suite (packages/napcat-test) with updated package dependency and resolve aliases. pnpm-lock updated to link the new package.
This commit is contained in:
1 parent
7bc3b3cc46
commit
b8c8df8a45
12 files changed
+597
-25
No files matched your search
Generated
+3
@@ -354,6 +354,9 @@ importers:
|
||||
napcat-core:
|
||||
specifier: workspace:*
|
||||
version: link:../napcat-core
|
||||
napcat-image-size:
|
||||
specifier: workspace:*
|
||||
version: link:../napcat-image-size
|
||||
devDependencies:
|
||||
vitest:
|
||||
specifier: ^4.0.9
|
||||
|
||||
Reference in new issue
Block a user