Skip to content

Commit

Permalink
Remove Node 18 from actions since it does not support CustomEvent.
Browse files Browse the repository at this point in the history
  • Loading branch information
codedread committed Jan 19, 2024
1 parent 1267691 commit d2f3516
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
}
});
Expand All @@ -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();
```
Expand Down

0 comments on commit d2f3516

Please sign in to comment.