mirror of
https://github.com/codedread/bitjs
synced 2025-10-03 01:29:17 +02:00
Remove Node 18 from actions since it does not support CustomEvent.
This commit is contained in:
parent
1267691579
commit
d2f35163c3
2 changed files with 17 additions and 6 deletions
2
.github/workflows/node.js.yml
vendored
2
.github/workflows/node.js.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x, 19.x, 20.x, 21.x]
|
||||
node-version: [19.x, 20.x, 21.x]
|
||||
# See NodeJS release schedule at https://nodejs.org/en/about/previous-releases.
|
||||
|
||||
steps:
|
||||
|
|
21
README.md
21
README.md
|
@ -118,12 +118,11 @@ import { GifParser } from './bitjs/image/parsers/gif.js'
|
|||
|
||||
const parser = new GifParser(someArrayBuffer);
|
||||
parser.onApplicationExtension(evt => {
|
||||
const appId = evt.applicationExtension.applicationIdentifier;
|
||||
const appAuthCode = new TextDecoder().decode(
|
||||
evt.applicationExtension.applicationAuthenticationCode);
|
||||
const appId = evt.detail.applicationIdentifier;
|
||||
const appAuthCode = new TextDecoder().decode(evt.detail.applicationAuthenticationCode);
|
||||
if (appId === 'XMP Data' && appAuthCode === 'XMP') {
|
||||
/** @type {Uint8Array} */
|
||||
const appData = evt.applicationExtension.applicationData;
|
||||
const appData = evt.detail.applicationData;
|
||||
// Do something with appData (parse the XMP).
|
||||
}
|
||||
});
|
||||
|
@ -137,7 +136,19 @@ import { ExifTagNumber } from './bitjs/image/parsers/exif.js';
|
|||
|
||||
const parser = new JpegParser(someArrayBuffer);
|
||||
parser.onApp1Exif(evt => {
|
||||
console.log(evt.exifValueMap.get(ExifTagNumber.IMAGE_DESCRIPTION).stringValue);
|
||||
console.log(evt.detail.get(ExifTagNumber.IMAGE_DESCRIPTION).stringValue);
|
||||
});
|
||||
await parser.start();
|
||||
```
|
||||
|
||||
#### PNG Parser
|
||||
```javascript
|
||||
import { PngParser } from './bitjs/image/parsers/png.js'
|
||||
import { ExifTagNumber } from './bitjs/image/parsers/exif.js';
|
||||
|
||||
const parser = new PngParser(someArrayBuffer);
|
||||
parser.onExifProfile(evt => {
|
||||
console.log(evt.detail.get(ExifTagNumber.IMAGE_DESCRIPTION).stringValue);
|
||||
});
|
||||
await parser.start();
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue