Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode XMP attribute values #47

Merged
merged 1 commit into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/exif-reader.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/exif-reader.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/xmp-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function getAttributes(element) {
const attributes = {};

for (let i = 0; i < element.attributes.length; i++) {
attributes[element.attributes[i].nodeName] = element.attributes[i].value;
attributes[element.attributes[i].nodeName] = decodeURIComponent(escape(element.attributes[i].value));
}

return attributes;
Expand Down
5 changes: 3 additions & 2 deletions test/xmp-tags-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ describe('xmp-tags', () => {
<xmp:MyXMPArray xml:lang="en">
<rdf:Bag>
<rdf:li>
<rdf:Description>
<rdf:Description xmp:MyXMPTag="AúC">
<rdf:value>47</rdf:value>
<mq:MyQualifier>My qualifier</mq:MyQualifier>
</rdf:Description>
Expand All @@ -369,7 +369,8 @@ describe('xmp-tags', () => {
{
value: '47',
attributes: {
MyQualifier: 'My qualifier'
MyQualifier: 'My qualifier',
MyXMPTag: 'AúC'
},
description: '47'
},
Expand Down