@eris/exif
Advanced tools
Comparing version 0.4.3-alpha.6 to 0.4.3-alpha.7
@@ -92,9 +92,10 @@ "use strict"; | ||
static isXMP(buffer) { | ||
const xmpHeader = '<x:xmpmet'; | ||
const xmpAltHeader = '<?xpacket'; | ||
for (let i = 0; i < xmpHeader.length; i++) { | ||
if (buffer[i] !== xmpHeader.charCodeAt(i) && buffer[i] !== xmpAltHeader.charCodeAt(i)) | ||
return false; | ||
} | ||
return true; | ||
const headers = ['<x:xmpmet', '<?xpacket', '<?xml']; | ||
return headers.some(header => { | ||
for (let i = 0; i < header.length; i++) { | ||
if (buffer[i] !== header.charCodeAt(i)) | ||
return false; | ||
} | ||
return true; | ||
}); | ||
} | ||
@@ -101,0 +102,0 @@ } |
@@ -100,11 +100,12 @@ import {IBufferLike, IGenericMetadata, IFDTagName, XMPTagName} from '../utils/types' | ||
public static isXMP(buffer: IBufferLike): boolean { | ||
const xmpHeader = '<x:xmpmet' | ||
const xmpAltHeader = '<?xpacket' | ||
for (let i = 0; i < xmpHeader.length; i++) { | ||
if (buffer[i] !== xmpHeader.charCodeAt(i) && buffer[i] !== xmpAltHeader.charCodeAt(i)) | ||
return false | ||
} | ||
const headers = ['<x:xmpmet', '<?xpacket', '<?xml'] | ||
return true | ||
return headers.some(header => { | ||
for (let i = 0; i < header.length; i++) { | ||
if (buffer[i] !== header.charCodeAt(i)) return false | ||
} | ||
return true | ||
}) | ||
} | ||
} |
{ | ||
"name": "@eris/exif", | ||
"version": "0.4.3-alpha.6", | ||
"version": "0.4.3-alpha.7", | ||
"description": "Parses EXIF data.", | ||
@@ -41,3 +41,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "98e79831aa0fc9c610e2ef9a44455f21b3d999cc" | ||
"gitHead": "09dedd0d48fd74d91fd74af9dd7748f6dfca5cf4" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5325
294382