@@ -118,12 +118,11 @@ import { GifParser } from './bitjs/image/parsers/gif.js'
118118
119119const parser = new GifParser (someArrayBuffer);
120120parser .onApplicationExtension (evt => {
121- const appId = evt .applicationExtension .applicationIdentifier ;
122- const appAuthCode = new TextDecoder ().decode (
123- evt .applicationExtension .applicationAuthenticationCode );
121+ const appId = evt .detail .applicationIdentifier ;
122+ const appAuthCode = new TextDecoder ().decode (evt .detail .applicationAuthenticationCode );
124123 if (appId === ' XMP Data' && appAuthCode === ' XMP' ) {
125124 /** @type {Uint8Array} */
126- const appData = evt .applicationExtension .applicationData ;
125+ const appData = evt .detail .applicationData ;
127126 // Do something with appData (parse the XMP).
128127 }
129128});
@@ -137,7 +136,19 @@ import { ExifTagNumber } from './bitjs/image/parsers/exif.js';
137136
138137const parser = new JpegParser (someArrayBuffer);
139138parser .onApp1Exif (evt => {
140- console .log (evt .exifValueMap .get (ExifTagNumber .IMAGE_DESCRIPTION ).stringValue );
139+ console .log (evt .detail .get (ExifTagNumber .IMAGE_DESCRIPTION ).stringValue );
140+ });
141+ await parser .start ();
142+ ```
143+
144+ #### PNG Parser
145+ ``` javascript
146+ import { PngParser } from ' ./bitjs/image/parsers/png.js'
147+ import { ExifTagNumber } from ' ./bitjs/image/parsers/exif.js' ;
148+
149+ const parser = new PngParser (someArrayBuffer);
150+ parser .onExifProfile (evt => {
151+ console .log (evt .detail .get (ExifTagNumber .IMAGE_DESCRIPTION ).stringValue );
141152});
142153await parser .start ();
143154```
0 commit comments