mirror of
https://gitee.com/Donal/ofd.js.git
synced 2024-12-02 03:48:44 +08:00
jb2 判断
This commit is contained in:
parent
c093128324
commit
78fe22cee0
@ -507,7 +507,7 @@ export default {
|
||||
if (item['@_Type'].toLowerCase() === 'image') {
|
||||
const format = item['@_Format'];
|
||||
const ext = getExtensionByPath(file);
|
||||
if (format && format.toLowerCase() === 'gbig2' || ext && ext.toLowerCase() === 'jb2') {
|
||||
if ((format && (format.toLowerCase() === 'gbig2' || format.toLowerCase() === 'jb2')) || ext && (ext.toLowerCase() === 'jb2' || ext.toLowerCase() === 'gbig2')) {
|
||||
const jbig2 = await this.getImageArrayFromZip(file);
|
||||
this.multiMediaResObj[item['@_ID']] = jbig2;
|
||||
} else {
|
||||
|
@ -159,9 +159,7 @@ export const replaceFirstSlash = function (str) {
|
||||
|
||||
export const getExtensionByPath = function (path) {
|
||||
if (!path && typeof path !== "string") return "";
|
||||
var matches = /\.([a-z]+)$/.exec(path);
|
||||
if (!matches) return "";
|
||||
return matches[1] || "";
|
||||
return path.substring(path.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user