hoeditor-web 3.0.82 → 3.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hoeditor.umd.js +1389 -282
- package/lib/hoeditor.umd.min.js +5 -5
- package/package.json +1 -1
package/lib/hoeditor.umd.js
CHANGED
|
@@ -45744,6 +45744,7 @@ var DomRange = /*#__PURE__*/function () {
|
|
|
45744
45744
|
// const hoEditorFactory = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
|
|
45745
45745
|
// const isValidPath = hoEditorFactory.docTree.checkPath(value);
|
|
45746
45746
|
if (value.indexOf("-") >= 0) {
|
|
45747
|
+
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_22__/* ["default"].destroy */ .Z.destroy();
|
|
45747
45748
|
//const hoEditorFactory = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
|
|
45748
45749
|
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_22__/* ["default"].warn */ .Z.warn("当前路径s(" + value + ")异常,请用鼠标点击一下页面(重获路径)再进行之后的操作。(" + this._startPath + ")");
|
|
45749
45750
|
this.setSamePath(this._startPath);
|
|
@@ -45763,6 +45764,7 @@ var DomRange = /*#__PURE__*/function () {
|
|
|
45763
45764
|
// const hoEditorFactory = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
|
|
45764
45765
|
// const isValidPath = hoEditorFactory.docTree.checkPath(value);
|
|
45765
45766
|
if (value.indexOf("-") >= 0) {
|
|
45767
|
+
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_22__/* ["default"].destroy */ .Z.destroy();
|
|
45766
45768
|
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_22__/* ["default"].warn */ .Z.warn("当前路径e(" + value + ")异常,请用鼠标点击一下页面(重获路径)再进行之后的操作。(" + this._endPath + ")");
|
|
45767
45769
|
this.setSamePath(this._endPath);
|
|
45768
45770
|
return;
|
|
@@ -65236,7 +65238,7 @@ var TableNode = /*#__PURE__*/function (_RectNode) {
|
|
|
65236
65238
|
/*
|
|
65237
65239
|
* @Author: your name
|
|
65238
65240
|
* @Date: 2020-11-03 15:17:54
|
|
65239
|
-
* @LastEditTime: 2023-
|
|
65241
|
+
* @LastEditTime: 2023-07-12 09:59:55
|
|
65240
65242
|
* @LastEditors: liyanan 2441631434@qq.com
|
|
65241
65243
|
* @Description: In User Settings Edit
|
|
65242
65244
|
* @FilePath: \hoeditor-web\src\editor\dom\treeNode\TextInputFieldNode.ts
|
|
@@ -67302,6 +67304,9 @@ var TextInputFieldNode = /*#__PURE__*/function (_BaseCombineNode) {
|
|
|
67302
67304
|
if (!(eChildNode instanceof _MarkNode__WEBPACK_IMPORTED_MODULE_45__/* .MarkNode */ .j) || eChildNode instanceof _MarkNode__WEBPACK_IMPORTED_MODULE_45__/* .MarkNode */ .j && eChildNode.MarkNodeType !== _MarkNode__WEBPACK_IMPORTED_MODULE_45__/* .MarkNodeType.mtEnd */ .q.mtEnd) {
|
|
67303
67305
|
throw new Error('经检测,病历元素“' + temp.name + '”的模板格式有问题,无法正常加载,请联系工程师进行处理。');
|
|
67304
67306
|
}
|
|
67307
|
+
if (temp.childNodes.length > 3 && temp.childNodes[1] instanceof _MarkNode__WEBPACK_IMPORTED_MODULE_45__/* .MarkNode */ .j) {
|
|
67308
|
+
temp.childNodes.splice(1, 1);
|
|
67309
|
+
}
|
|
67305
67310
|
}
|
|
67306
67311
|
if (temp.childNodes[1] instanceof _TableFormula__WEBPACK_IMPORTED_MODULE_53__/* .TableFormula */ .N) {
|
|
67307
67312
|
return temp;
|
|
@@ -74236,6 +74241,14 @@ var inherits = __webpack_require__(11651);
|
|
|
74236
74241
|
var createSuper = __webpack_require__(19593);
|
|
74237
74242
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
74238
74243
|
var defineProperty = __webpack_require__(78255);
|
|
74244
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
|
|
74245
|
+
var es_function_name = __webpack_require__(68309);
|
|
74246
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.includes.js
|
|
74247
|
+
var es_array_includes = __webpack_require__(26699);
|
|
74248
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.includes.js
|
|
74249
|
+
var es_string_includes = __webpack_require__(32023);
|
|
74250
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.splice.js
|
|
74251
|
+
var es_array_splice = __webpack_require__(40561);
|
|
74239
74252
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.error.cause.js
|
|
74240
74253
|
var es_error_cause = __webpack_require__(21703);
|
|
74241
74254
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
@@ -74553,6 +74566,10 @@ var DrawPageTable = __webpack_require__(15694);
|
|
|
74553
74566
|
|
|
74554
74567
|
|
|
74555
74568
|
|
|
74569
|
+
|
|
74570
|
+
|
|
74571
|
+
|
|
74572
|
+
|
|
74556
74573
|
|
|
74557
74574
|
|
|
74558
74575
|
|
|
@@ -74584,6 +74601,7 @@ var DrawPageCell = /*#__PURE__*/function (_DrawArea) {
|
|
|
74584
74601
|
_this._drawPageTable = dPartTable;
|
|
74585
74602
|
// this._crossShape = null;
|
|
74586
74603
|
_this._backImg = new createjs.Shape();
|
|
74604
|
+
_this._backImg.name = "backImg";
|
|
74587
74605
|
_this._topLine = new createjs.Shape();
|
|
74588
74606
|
_this._bottomLine = new createjs.Shape();
|
|
74589
74607
|
_this._leftLine = new createjs.Shape();
|
|
@@ -75065,10 +75083,159 @@ var DrawPageCell = /*#__PURE__*/function (_DrawArea) {
|
|
|
75065
75083
|
}
|
|
75066
75084
|
this._backImg.graphics.endStroke();
|
|
75067
75085
|
}
|
|
75086
|
+
}, {
|
|
75087
|
+
key: "paintCellBorders",
|
|
75088
|
+
value: function paintCellBorders(newHeight, r, c) {
|
|
75089
|
+
if (this._cell.cellProperty.isDrawGridlines) {
|
|
75090
|
+
var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys.instance */.b.instance().getFactory(this._hoEditorFactoryID);
|
|
75091
|
+
var x = 0.5;
|
|
75092
|
+
var y = 0.5;
|
|
75093
|
+
var dWidth = this._dWidth - 0.5;
|
|
75094
|
+
var height = newHeight - 0.5;
|
|
75095
|
+
if (r > this._drawPageTable.startRow) {
|
|
75096
|
+
y = -0.5;
|
|
75097
|
+
height += 0.5;
|
|
75098
|
+
}
|
|
75099
|
+
if (c > 0) {
|
|
75100
|
+
x = -0.5;
|
|
75101
|
+
dWidth = this._dWidth + 0.5;
|
|
75102
|
+
}
|
|
75103
|
+
this._topLine.graphics.clear();
|
|
75104
|
+
this._bottomLine.graphics.clear();
|
|
75105
|
+
this._leftLine.graphics.clear();
|
|
75106
|
+
this._rightLine.graphics.clear();
|
|
75107
|
+
var printGridLines = this._cell.cellProperty.printGridLines;
|
|
75108
|
+
var gridLineDisplay = this._cell.cellProperty.gridLineDisplay;
|
|
75109
|
+
var gridLinesColor = this._cell.cellProperty.gridLinesColor;
|
|
75110
|
+
if (printGridLines || !printGridLines && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPreview */.Dh.psPreview && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPrint */.Dh.psPrint) {
|
|
75111
|
+
if (gridLineDisplay[0]) {
|
|
75112
|
+
//上边框
|
|
75113
|
+
if (r == 0 || this.dTop == 0) {
|
|
75114
|
+
this._topLine.name = "topLine";
|
|
75115
|
+
this._topLine.graphics.beginStroke(gridLinesColor[0]);
|
|
75116
|
+
if (printGridLines && this.cell.cellProperty.gridLinesStyle !== TableProperty/* GridLinesStyle.solid */.he.solid || !printGridLines && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPreview */.Dh.psPreview && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPrint */.Dh.psPrint) {
|
|
75117
|
+
this._topLine.graphics.setStrokeDash([2, 2]);
|
|
75118
|
+
} else {
|
|
75119
|
+
this._topLine.graphics.setStrokeStyle(1, 0, 0, undefined, true);
|
|
75120
|
+
}
|
|
75121
|
+
this._topLine.graphics.moveTo(x, y).lineTo(x + dWidth, y);
|
|
75122
|
+
this._topLine.graphics.endStroke();
|
|
75123
|
+
if (!this.children.includes(this._topLine)) {
|
|
75124
|
+
this.addChild(this._topLine);
|
|
75125
|
+
}
|
|
75126
|
+
}
|
|
75127
|
+
} else {
|
|
75128
|
+
if (r > 0) {
|
|
75129
|
+
var topCell = this._cell.table.getMainCell(r - 1, c)[0];
|
|
75130
|
+
var drawPageCells = topCell.drawCell.drawPageCells;
|
|
75131
|
+
if (drawPageCells.length > 0) {
|
|
75132
|
+
for (var i = 0; i < drawPageCells[drawPageCells.length - 1].children.length; i++) {
|
|
75133
|
+
var child = drawPageCells[drawPageCells.length - 1].children[i];
|
|
75134
|
+
if (child.name == "bottomLine") {
|
|
75135
|
+
drawPageCells[drawPageCells.length - 1].children.splice(i, 1);
|
|
75136
|
+
}
|
|
75137
|
+
}
|
|
75138
|
+
}
|
|
75139
|
+
}
|
|
75140
|
+
}
|
|
75141
|
+
if (gridLineDisplay[1]) {
|
|
75142
|
+
//下边框
|
|
75143
|
+
this._bottomLine.name = "bottomLine";
|
|
75144
|
+
this._bottomLine.graphics.beginStroke(gridLinesColor[1]);
|
|
75145
|
+
if (printGridLines && this.cell.cellProperty.gridLinesStyle !== TableProperty/* GridLinesStyle.solid */.he.solid || !printGridLines && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPreview */.Dh.psPreview && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPrint */.Dh.psPrint) {
|
|
75146
|
+
this._bottomLine.graphics.setStrokeDash([2, 2]);
|
|
75147
|
+
} else {
|
|
75148
|
+
this._bottomLine.graphics.setStrokeStyle(1, 0, 0, undefined, true);
|
|
75149
|
+
}
|
|
75150
|
+
this._bottomLine.graphics.moveTo(x, y + height).lineTo(x + dWidth, y + height);
|
|
75151
|
+
this._bottomLine.graphics.endStroke();
|
|
75152
|
+
if (!this.children.includes(this._bottomLine)) {
|
|
75153
|
+
this.addChild(this._bottomLine);
|
|
75154
|
+
}
|
|
75155
|
+
} else {
|
|
75156
|
+
if (r < this.cell.table.rowCount - 1) {
|
|
75157
|
+
var bottomCell = this._cell.table.getMainCell(r + 1, c)[0];
|
|
75158
|
+
var _drawPageCells = bottomCell.drawCell.drawPageCells;
|
|
75159
|
+
if (_drawPageCells.length > 0) {
|
|
75160
|
+
for (var _i = 0; _i < _drawPageCells[0].children.length; _i++) {
|
|
75161
|
+
var _child = _drawPageCells[0].children[_i];
|
|
75162
|
+
if (_child.name == "topLine") {
|
|
75163
|
+
_drawPageCells[0].children.splice(_i, 1);
|
|
75164
|
+
}
|
|
75165
|
+
}
|
|
75166
|
+
}
|
|
75167
|
+
}
|
|
75168
|
+
}
|
|
75169
|
+
if (gridLineDisplay[2]) {
|
|
75170
|
+
//左边框
|
|
75171
|
+
if (c == 0) {
|
|
75172
|
+
this._leftLine.name = "leftLine";
|
|
75173
|
+
this._leftLine.graphics.beginStroke(gridLinesColor[2]);
|
|
75174
|
+
if (printGridLines && this.cell.cellProperty.gridLinesStyle !== TableProperty/* GridLinesStyle.solid */.he.solid || !printGridLines && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPreview */.Dh.psPreview && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPrint */.Dh.psPrint) {
|
|
75175
|
+
this._leftLine.graphics.setStrokeDash([2, 2]);
|
|
75176
|
+
} else {
|
|
75177
|
+
this._leftLine.graphics.setStrokeStyle(1, 0, 0, undefined, true);
|
|
75178
|
+
}
|
|
75179
|
+
this._leftLine.graphics.moveTo(x, y).lineTo(x, y + height);
|
|
75180
|
+
this._leftLine.graphics.endStroke();
|
|
75181
|
+
if (!this.children.includes(this._leftLine)) {
|
|
75182
|
+
this.addChild(this._leftLine);
|
|
75183
|
+
}
|
|
75184
|
+
}
|
|
75185
|
+
} else {
|
|
75186
|
+
if (c > 0) {
|
|
75187
|
+
var leftCell = this._cell.table.getMainCell(r, c - 1)[0];
|
|
75188
|
+
var _drawPageCells2 = leftCell.drawCell.drawPageCells;
|
|
75189
|
+
if (_drawPageCells2.length > 0) {
|
|
75190
|
+
for (var _i2 = 0; _i2 < _drawPageCells2.length; _i2++) {
|
|
75191
|
+
var children = _drawPageCells2[_i2].children;
|
|
75192
|
+
for (var j = 0; j < children.length; j++) {
|
|
75193
|
+
var _child2 = children[j];
|
|
75194
|
+
if (_child2.name == "rightLine") {
|
|
75195
|
+
children.splice(j, 1);
|
|
75196
|
+
}
|
|
75197
|
+
}
|
|
75198
|
+
}
|
|
75199
|
+
}
|
|
75200
|
+
}
|
|
75201
|
+
}
|
|
75202
|
+
if (gridLineDisplay[3]) {
|
|
75203
|
+
//右边框
|
|
75204
|
+
this._rightLine.name = "rightLine";
|
|
75205
|
+
this._rightLine.graphics.beginStroke(gridLinesColor[3]);
|
|
75206
|
+
if (printGridLines && this.cell.cellProperty.gridLinesStyle !== TableProperty/* GridLinesStyle.solid */.he.solid || !printGridLines && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPreview */.Dh.psPreview && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPrint */.Dh.psPrint) {
|
|
75207
|
+
this._rightLine.graphics.setStrokeDash([2, 2]);
|
|
75208
|
+
} else {
|
|
75209
|
+
this._rightLine.graphics.setStrokeStyle(1, 0, 0, undefined, true);
|
|
75210
|
+
}
|
|
75211
|
+
this._rightLine.graphics.moveTo(x + dWidth, y).lineTo(x + dWidth, y + height);
|
|
75212
|
+
this._rightLine.graphics.endStroke();
|
|
75213
|
+
if (!this.children.includes(this._rightLine)) {
|
|
75214
|
+
this.addChild(this._rightLine);
|
|
75215
|
+
}
|
|
75216
|
+
} else {
|
|
75217
|
+
if (c < this.cell.table.colCount - 1) {
|
|
75218
|
+
var rightCell = this._cell.table.getMainCell(r, c + 1)[0];
|
|
75219
|
+
var _drawPageCells3 = rightCell.drawCell.drawPageCells;
|
|
75220
|
+
if (_drawPageCells3.length > 0) {
|
|
75221
|
+
for (var _i3 = 0; _i3 < _drawPageCells3.length; _i3++) {
|
|
75222
|
+
var _children = _drawPageCells3[_i3].children;
|
|
75223
|
+
for (var _j = 0; _j < _children.length; _j++) {
|
|
75224
|
+
var _child3 = _children[_j];
|
|
75225
|
+
if (_child3.name == "leftLine") {
|
|
75226
|
+
_children.splice(_j, 1);
|
|
75227
|
+
}
|
|
75228
|
+
}
|
|
75229
|
+
}
|
|
75230
|
+
}
|
|
75231
|
+
}
|
|
75232
|
+
}
|
|
75233
|
+
}
|
|
75234
|
+
}
|
|
75235
|
+
}
|
|
75068
75236
|
}, {
|
|
75069
75237
|
key: "paintCellBackground",
|
|
75070
75238
|
value: function paintCellBackground(newHeight, r, c) {
|
|
75071
|
-
var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys.instance */.b.instance().getFactory(this._hoEditorFactoryID);
|
|
75072
75239
|
this._backImg.x = 0;
|
|
75073
75240
|
this._backImg.y = 0;
|
|
75074
75241
|
// this._backImg.uncache();
|
|
@@ -75076,171 +75243,12 @@ var DrawPageCell = /*#__PURE__*/function (_DrawArea) {
|
|
|
75076
75243
|
this._backImg.graphics.beginFill(this._cell.cellProperty.backColor === '#FFFFFF' ? 'transparent' : this._cell.cellProperty.backColor);
|
|
75077
75244
|
this._backImg.graphics.rect(1, 1, this.dWidth - 1, this.dHeight - 1);
|
|
75078
75245
|
this._backImg.graphics.endFill();
|
|
75079
|
-
|
|
75080
|
-
// const rightCell = this._cell.table.getMainCell(r, c + this._cell.colSpan)[0];
|
|
75081
|
-
// this.paintNeerByCellBorder(rightCell, this._dWidth, 0, this._dWidth, this._dHeight);
|
|
75082
|
-
// }
|
|
75083
|
-
// if (r + this._cell.rowSpan <= this._cell.table.rowCount - 1) {
|
|
75084
|
-
// const bottomCell = this._cell.table.getMainCell(r + this._cell.rowSpan, c)[0];
|
|
75085
|
-
// this.paintNeerByCellBorder(bottomCell, 0, this._dHeight, this._dWidth, this._dHeight);
|
|
75086
|
-
// }
|
|
75087
|
-
this._backImg.graphics.beginStroke(this._cell.cellProperty.gridLinesColor[0]);
|
|
75088
|
-
if (this._cell.cellProperty.isDrawGridlines) {
|
|
75089
|
-
if (!this._cell.cellProperty.printGridLines && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPreview */.Dh.psPreview && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPrint */.Dh.psPrint) {
|
|
75090
|
-
this._backImg.graphics.setStrokeDash([2, 2]);
|
|
75091
|
-
}
|
|
75092
|
-
if (this._cell.cellProperty.printGridLines || !this._cell.cellProperty.printGridLines && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPreview */.Dh.psPreview && hoEditorFactory.drawTree.paintStatus !== DrawTree/* PaintState.psPrint */.Dh.psPrint) {
|
|
75093
|
-
var x = 0.5;
|
|
75094
|
-
var y = 0.5;
|
|
75095
|
-
var dWidth = this._dWidth - 0.5;
|
|
75096
|
-
var height = newHeight - 0.5;
|
|
75097
|
-
if (this.cell.cellProperty.gridLinesStyle === TableProperty/* GridLinesStyle.solid */.he.solid) {
|
|
75098
|
-
this._backImg.graphics.setStrokeStyle(0.5);
|
|
75099
|
-
} else {
|
|
75100
|
-
this._backImg.graphics.setStrokeDash([2, 2]);
|
|
75101
|
-
}
|
|
75102
|
-
if (r > this._drawPageTable.startRow) {
|
|
75103
|
-
y = -0.5;
|
|
75104
|
-
height += 0.5;
|
|
75105
|
-
}
|
|
75106
|
-
if (c > 0) {
|
|
75107
|
-
x = -0.5;
|
|
75108
|
-
dWidth = this._dWidth + 0.5;
|
|
75109
|
-
}
|
|
75110
|
-
this._backImg.graphics.drawRect(x, y, dWidth, height);
|
|
75111
|
-
/*
|
|
75112
|
-
const gridLineDisplay = this._cell.cellProperty.gridLineDisplay;
|
|
75113
|
-
const gridLinesColor = this._cell.cellProperty.gridLinesColor;
|
|
75114
|
-
const colNo = this.cell.row.indexOf(this.cell);
|
|
75115
|
-
const rowNo = this.cell.table.rows.indexOf(this.cell.row);
|
|
75116
|
-
if (gridLineDisplay[0]) {//上边框
|
|
75117
|
-
if (rowNo == 0) {
|
|
75118
|
-
this._topLine.name = "topLine";
|
|
75119
|
-
this._topLine.graphics.clear().beginStroke(gridLinesColor[0]);
|
|
75120
|
-
if (this.cell.cellProperty.gridLinesStyle === GridLinesStyle.solid) {
|
|
75121
|
-
this._topLine.graphics.setStrokeStyle(0.5);
|
|
75122
|
-
} else {
|
|
75123
|
-
this._topLine.graphics.setStrokeDash([2, 2]);
|
|
75124
|
-
}
|
|
75125
|
-
this._topLine.graphics.moveTo(x, y).lineTo(x + dWidth, y);
|
|
75126
|
-
this._topLine.graphics.endStroke();
|
|
75127
|
-
if (!this.contains(this._topLine)) {
|
|
75128
|
-
this.addChild(this._topLine);
|
|
75129
|
-
}
|
|
75130
|
-
}
|
|
75131
|
-
} else {
|
|
75132
|
-
if (rowNo > 0) {
|
|
75133
|
-
const topCell = this._cell.table.getMainCell(rowNo - 1, colNo)[0];
|
|
75134
|
-
const drawPageCells = topCell.drawCell.drawPageCells;
|
|
75135
|
-
if (drawPageCells.length > 0) {
|
|
75136
|
-
for (let i = 0; i < drawPageCells[drawPageCells.length - 1].children.length; i++) {
|
|
75137
|
-
const child = drawPageCells[drawPageCells.length - 1].children[i];
|
|
75138
|
-
if (child.name == "bottomLine") {
|
|
75139
|
-
drawPageCells[drawPageCells.length - 1].children.splice(i, 1);
|
|
75140
|
-
}
|
|
75141
|
-
}
|
|
75142
|
-
}
|
|
75143
|
-
}
|
|
75144
|
-
}
|
|
75145
|
-
if (gridLineDisplay[1]) {//下边框
|
|
75146
|
-
this._bottomLine.name = "bottomLine";
|
|
75147
|
-
this._bottomLine.graphics.clear().beginStroke(gridLinesColor[1]);
|
|
75148
|
-
if (this.cell.cellProperty.gridLinesStyle === GridLinesStyle.solid) {
|
|
75149
|
-
this._bottomLine.graphics.setStrokeStyle(0.5);
|
|
75150
|
-
} else {
|
|
75151
|
-
this._bottomLine.graphics.setStrokeDash([2, 2]);
|
|
75152
|
-
}
|
|
75153
|
-
this._bottomLine.graphics.moveTo(x, y + height).lineTo(x + dWidth, y + height);
|
|
75154
|
-
this._bottomLine.graphics.endStroke();
|
|
75155
|
-
if (!this.contains(this._bottomLine)) {
|
|
75156
|
-
this.addChild(this._bottomLine);
|
|
75157
|
-
}
|
|
75158
|
-
} else {
|
|
75159
|
-
if (rowNo < this.cell.table.rowCount - 1) {
|
|
75160
|
-
const bottomCell = this._cell.table.getMainCell(rowNo + 1, colNo)[0];
|
|
75161
|
-
const drawPageCells = bottomCell.drawCell.drawPageCells;
|
|
75162
|
-
if (drawPageCells.length > 0) {
|
|
75163
|
-
for (let i = 0; i < drawPageCells[0].children.length; i++) {
|
|
75164
|
-
const child = drawPageCells[0].children[i];
|
|
75165
|
-
if (child.name == "topLine") {
|
|
75166
|
-
drawPageCells[0].children.splice(i, 1);
|
|
75167
|
-
}
|
|
75168
|
-
}
|
|
75169
|
-
}
|
|
75170
|
-
}
|
|
75171
|
-
}
|
|
75172
|
-
if (gridLineDisplay[2]) {//左边框
|
|
75173
|
-
if (colNo == 0) {
|
|
75174
|
-
this._leftLine.name = "leftLine";
|
|
75175
|
-
this._leftLine.graphics.clear().beginStroke(gridLinesColor[2]);
|
|
75176
|
-
if (this.cell.cellProperty.gridLinesStyle === GridLinesStyle.solid) {
|
|
75177
|
-
this._leftLine.graphics.setStrokeStyle(0.5);
|
|
75178
|
-
} else {
|
|
75179
|
-
this._leftLine.graphics.setStrokeDash([2, 2]);
|
|
75180
|
-
}
|
|
75181
|
-
this._leftLine.graphics.moveTo(x, y).lineTo(x, y + height);
|
|
75182
|
-
this._leftLine.graphics.endStroke();
|
|
75183
|
-
if (!this.contains(this._leftLine)) {
|
|
75184
|
-
this.addChild(this._leftLine);
|
|
75185
|
-
}
|
|
75186
|
-
}
|
|
75187
|
-
} else {
|
|
75188
|
-
if (colNo > 0) {
|
|
75189
|
-
const leftCell = this._cell.table.getMainCell(rowNo, colNo - 1)[0];
|
|
75190
|
-
const drawPageCells = leftCell.drawCell.drawPageCells;
|
|
75191
|
-
if (drawPageCells.length > 0) {
|
|
75192
|
-
for (let i = 0; i < drawPageCells.length; i++) {
|
|
75193
|
-
const children = drawPageCells[i].children;
|
|
75194
|
-
for (let j = 0; j < children.length; j++) {
|
|
75195
|
-
const child = children[j];
|
|
75196
|
-
if (child.name == "rightLine") {
|
|
75197
|
-
children.splice(j, 1);
|
|
75198
|
-
}
|
|
75199
|
-
}
|
|
75200
|
-
}
|
|
75201
|
-
}
|
|
75202
|
-
}
|
|
75203
|
-
}
|
|
75204
|
-
if (gridLineDisplay[3]) {//右边框
|
|
75205
|
-
this._rightLine.name = "rightLine";
|
|
75206
|
-
this._rightLine.graphics.clear().beginStroke(gridLinesColor[3]);
|
|
75207
|
-
if (this.cell.cellProperty.gridLinesStyle === GridLinesStyle.solid) {
|
|
75208
|
-
this._rightLine.graphics.setStrokeStyle(0.5);
|
|
75209
|
-
} else {
|
|
75210
|
-
this._rightLine.graphics.setStrokeDash([2, 2]);
|
|
75211
|
-
}
|
|
75212
|
-
this._rightLine.graphics.moveTo(x + dWidth, y).lineTo(x + dWidth, y + height);
|
|
75213
|
-
this._rightLine.graphics.endStroke();
|
|
75214
|
-
if (!this.contains(this._rightLine)) {
|
|
75215
|
-
this.addChild(this._rightLine);
|
|
75216
|
-
}
|
|
75217
|
-
} else {
|
|
75218
|
-
if (colNo < this.cell.table.colCount - 1) {
|
|
75219
|
-
const rightCell = this._cell.table.getMainCell(rowNo, colNo + 1)[0];
|
|
75220
|
-
const drawPageCells = rightCell.drawCell.drawPageCells;
|
|
75221
|
-
if (drawPageCells.length > 0) {
|
|
75222
|
-
for (let i = 0; i < drawPageCells.length; i++) {
|
|
75223
|
-
const children = drawPageCells[i].children;
|
|
75224
|
-
for (let j = 0; j < children.length; j++) {
|
|
75225
|
-
const child = children[j];
|
|
75226
|
-
if (child.name == "leftLine") {
|
|
75227
|
-
children.splice(j, 1);
|
|
75228
|
-
}
|
|
75229
|
-
}
|
|
75230
|
-
}
|
|
75231
|
-
}
|
|
75232
|
-
}
|
|
75233
|
-
}
|
|
75234
|
-
*/
|
|
75235
|
-
}
|
|
75236
|
-
}
|
|
75237
|
-
|
|
75238
|
-
this._backImg.graphics.endStroke();
|
|
75239
|
-
if (!this.contains(this._backImg)) {
|
|
75246
|
+
if (!this.children.includes(this._backImg)) {
|
|
75240
75247
|
this.addChildAt(this._backImg, 0);
|
|
75241
75248
|
} else {
|
|
75242
75249
|
this.setChildIndex(this._backImg, 0);
|
|
75243
75250
|
}
|
|
75251
|
+
this.paintCellBorders(newHeight, r, c);
|
|
75244
75252
|
if (this._cell.needPaintLineGrid()) this.paintLineGrid();
|
|
75245
75253
|
this.setBounds(0, 0, this._dWidth, newHeight);
|
|
75246
75254
|
// this._backImg.cache(0, 0, this._dWidth, newHeight);
|
|
@@ -75346,8 +75354,8 @@ var DrawPageCell = /*#__PURE__*/function (_DrawArea) {
|
|
|
75346
75354
|
var pageTableIndex = this._cell.table.drawTable.drawPageTables.indexOf(dPageCell._drawPageTable);
|
|
75347
75355
|
var pageCellIndex = this._cell.drawCell.drawPageCells.length - 1;
|
|
75348
75356
|
var cellrestHeight = rowHeightArr[pageTableIndex][0];
|
|
75349
|
-
for (var
|
|
75350
|
-
var dObj = this._cell.drawCell.drawLines[
|
|
75357
|
+
for (var _i4 = childCount - 1; _i4 >= 0; _i4--) {
|
|
75358
|
+
var dObj = this._cell.drawCell.drawLines[_i4];
|
|
75351
75359
|
if (dObj instanceof DrawLine/* DrawLine */.a || dObj instanceof DrawPageTable/* DrawPageTable */.ox) {
|
|
75352
75360
|
while (pageCellIndex > 0 && cellrestHeight < dObj.dHeight) {
|
|
75353
75361
|
pageCellIndex -= 1;
|
|
@@ -77837,6 +77845,7 @@ var DrawSignNode = /*#__PURE__*/function (_DrawCombineNode) {
|
|
|
77837
77845
|
//职称
|
|
77838
77846
|
|
|
77839
77847
|
//日期位置 1放签名右侧 其它:放签名下面
|
|
77848
|
+
|
|
77840
77849
|
function DrawSignNode(hoeditfactoryID, rootPath, node, number, type, name, imgSrc, imgWidth, imgHeight, cbStyle, fingerPrintSrc, fingerPosition, attribute, customProperty, connectChar, otherProperties) {
|
|
77841
77850
|
var _this;
|
|
77842
77851
|
(0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(this, DrawSignNode);
|
|
@@ -77858,6 +77867,7 @@ var DrawSignNode = /*#__PURE__*/function (_DrawCombineNode) {
|
|
|
77858
77867
|
(0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)((0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(_this), "_title", "");
|
|
77859
77868
|
(0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)((0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(_this), "_drawTitle", void 0);
|
|
77860
77869
|
(0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)((0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(_this), "_timePosition", "0");
|
|
77870
|
+
(0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)((0,D_project_go_test_createJS_hoeditor_web_node_modules_babel_runtime_helpers_esm_assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(_this), "_exif", null);
|
|
77861
77871
|
_this._number = number;
|
|
77862
77872
|
_this._imgSrc = imgSrc;
|
|
77863
77873
|
_this._type = type;
|
|
@@ -78394,107 +78404,112 @@ var DrawSignNode = /*#__PURE__*/function (_DrawCombineNode) {
|
|
|
78394
78404
|
var hoEditorFactory = _HOEditorFactorys__WEBPACK_IMPORTED_MODULE_10__/* .HOEditorFactorys.instance */ .b.instance().getFactory(drawNode.node.hoEditorFactoryID);
|
|
78395
78405
|
hoEditorFactory.loadImageCount++;
|
|
78396
78406
|
image.onload = function () {
|
|
78397
|
-
var
|
|
78398
|
-
|
|
78399
|
-
|
|
78400
|
-
|
|
78401
|
-
|
|
78402
|
-
|
|
78403
|
-
|
|
78404
|
-
node.imgWidth
|
|
78405
|
-
|
|
78406
|
-
|
|
78407
|
-
var width = hitWidth * hoEditorFactory.signHeight / image.naturalHeight; //+ this._drawText.getMeasuredWidth();
|
|
78408
|
-
if (node.parentNode instanceof _editor_dom_treeNode_CellNode__WEBPACK_IMPORTED_MODULE_7__/* .CellNode */ .D) {
|
|
78409
|
-
var cellWidth = node.parentNode.drawCell.dWidth;
|
|
78410
|
-
if (width > cellWidth - 5) {
|
|
78411
|
-
drawNode.dHeight = (cellWidth - 5) * hoEditorFactory.signHeight / width;
|
|
78412
|
-
width = cellWidth - 5;
|
|
78407
|
+
var handleOrientation = function handleOrientation() {
|
|
78408
|
+
var hitWidth = image.naturalWidth !== 0 ? image.naturalWidth : image.width;
|
|
78409
|
+
var hitHeight = image.naturalHeight !== 0 ? image.naturalHeight : image.height;
|
|
78410
|
+
// 处理宽高和实际宽高相反的问题 --- 2.0.66版本问题 --2.0.68后版本临时处理 再过几个版本后可以删掉
|
|
78411
|
+
var node = _this3.node;
|
|
78412
|
+
var nodeImageWidth = node.imgWidth;
|
|
78413
|
+
var nodeImageHeight = node.imgHeight;
|
|
78414
|
+
if (image.naturalWidth > image.naturalHeight && nodeImageWidth < nodeImageHeight || image.naturalWidth < image.naturalHeight && node.imgWidth > node.imgHeight) {
|
|
78415
|
+
node.imgWidth = nodeImageHeight;
|
|
78416
|
+
node.imgHeight = nodeImageWidth;
|
|
78413
78417
|
}
|
|
78414
|
-
|
|
78415
|
-
|
|
78416
|
-
|
|
78417
|
-
|
|
78418
|
-
|
|
78419
|
-
|
|
78420
|
-
|
|
78421
|
-
if (_this3._drawDate.getMeasuredWidth() > drawNode.dWidth) {
|
|
78422
|
-
drawNode.dWidth = _this3._drawDate.getMeasuredWidth();
|
|
78418
|
+
var width = hitWidth * hoEditorFactory.signHeight / image.naturalHeight; //+ this._drawText.getMeasuredWidth();
|
|
78419
|
+
if (node.parentNode instanceof _editor_dom_treeNode_CellNode__WEBPACK_IMPORTED_MODULE_7__/* .CellNode */ .D) {
|
|
78420
|
+
var cellWidth = node.parentNode.drawCell.dWidth;
|
|
78421
|
+
if (width > cellWidth - 5) {
|
|
78422
|
+
drawNode.dHeight = (cellWidth - 5) * hoEditorFactory.signHeight / width;
|
|
78423
|
+
width = cellWidth - 5;
|
|
78424
|
+
}
|
|
78423
78425
|
}
|
|
78424
|
-
|
|
78425
|
-
|
|
78426
|
-
|
|
78426
|
+
drawNode.dWidth = width;
|
|
78427
|
+
if (drawNode.attribute === 2 && drawNode.abi02 !== "") {
|
|
78428
|
+
drawNode.dWidth += drawNode._drawAbi02.getMeasuredWidth();
|
|
78429
|
+
}
|
|
78430
|
+
if (drawNode.attribute == 3 && drawNode.title != "") {
|
|
78427
78431
|
drawNode.dWidth += drawNode._drawTitle.getMeasuredWidth();
|
|
78432
|
+
if (_this3._drawDate.getMeasuredWidth() > drawNode.dWidth) {
|
|
78433
|
+
drawNode.dWidth = _this3._drawDate.getMeasuredWidth();
|
|
78434
|
+
}
|
|
78428
78435
|
}
|
|
78429
|
-
if (
|
|
78430
|
-
if (
|
|
78431
|
-
drawNode.dWidth
|
|
78432
|
-
}
|
|
78433
|
-
|
|
78436
|
+
if (drawNode.attribute === 4) {
|
|
78437
|
+
if (drawNode.title != "") {
|
|
78438
|
+
drawNode.dWidth += drawNode._drawTitle.getMeasuredWidth();
|
|
78439
|
+
}
|
|
78440
|
+
if (_this3.signTime !== "") {
|
|
78441
|
+
if (_this3.timePosition === "1") {
|
|
78442
|
+
drawNode.dWidth = drawNode.dWidth + drawNode._drawDate.getMeasuredWidth();
|
|
78443
|
+
} else {
|
|
78444
|
+
drawNode.dWidth = Math.max(drawNode.dWidth, drawNode._drawDate.getMeasuredWidth());
|
|
78445
|
+
}
|
|
78434
78446
|
}
|
|
78435
78447
|
}
|
|
78436
|
-
|
|
78437
|
-
|
|
78438
|
-
drawNode.dWidth += _this3._drawText ? _this3._drawText.getMeasuredWidth() : 0;
|
|
78439
|
-
}
|
|
78440
|
-
if (drawNode.attribute === 2 && drawNode.abi02 !== "") {
|
|
78441
|
-
bitmap.setTransform(drawNode._drawAbi02.getMeasuredWidth(), -drawNode.dHeight + 2, width / hitWidth, drawNode.dHeight / hitHeight);
|
|
78442
|
-
} else if (drawNode.attribute === 3 && drawNode.title !== "") {
|
|
78443
|
-
bitmap.setTransform(drawNode._drawTitle.getMeasuredWidth(), -drawNode.dHeight - 4, width / hitWidth, (drawNode.dHeight - drawNode._drawDate.getMeasuredHeight() - 2) / hitHeight);
|
|
78444
|
-
} else if (drawNode.attribute === 4) {
|
|
78445
|
-
var x = 0;
|
|
78446
|
-
var y = 0;
|
|
78447
|
-
var scaleY = drawNode.dHeight / hitHeight;
|
|
78448
|
-
if (drawNode.title !== "") {
|
|
78449
|
-
x = drawNode._drawTitle.getMeasuredWidth();
|
|
78450
|
-
} else {
|
|
78451
|
-
x = 0;
|
|
78448
|
+
if (_this3.number === 2) {
|
|
78449
|
+
drawNode.dWidth += _this3._drawText ? _this3._drawText.getMeasuredWidth() : 0;
|
|
78452
78450
|
}
|
|
78453
|
-
if (
|
|
78454
|
-
|
|
78455
|
-
|
|
78456
|
-
|
|
78457
|
-
|
|
78451
|
+
if (drawNode.attribute === 2 && drawNode.abi02 !== "") {
|
|
78452
|
+
bitmap.setTransform(drawNode._drawAbi02.getMeasuredWidth(), -drawNode.dHeight + 2, width / hitWidth, drawNode.dHeight / hitHeight);
|
|
78453
|
+
} else if (drawNode.attribute === 3 && drawNode.title !== "") {
|
|
78454
|
+
bitmap.setTransform(drawNode._drawTitle.getMeasuredWidth(), -drawNode.dHeight - 4, width / hitWidth, (drawNode.dHeight - drawNode._drawDate.getMeasuredHeight() - 2) / hitHeight);
|
|
78455
|
+
} else if (drawNode.attribute === 4) {
|
|
78456
|
+
var x = 0;
|
|
78457
|
+
var y = 0;
|
|
78458
|
+
var scaleY = drawNode.dHeight / hitHeight;
|
|
78459
|
+
if (drawNode.title !== "") {
|
|
78460
|
+
x = drawNode._drawTitle.getMeasuredWidth();
|
|
78461
|
+
} else {
|
|
78462
|
+
x = 0;
|
|
78463
|
+
}
|
|
78464
|
+
if (_this3.signTime === "") {
|
|
78458
78465
|
y = -drawNode.dHeight + 5;
|
|
78459
78466
|
scaleY = drawNode.dHeight / hitHeight;
|
|
78460
78467
|
} else {
|
|
78461
|
-
|
|
78462
|
-
|
|
78468
|
+
if (_this3.timePosition === "1") {
|
|
78469
|
+
y = -drawNode.dHeight + 5;
|
|
78470
|
+
scaleY = drawNode.dHeight / hitHeight;
|
|
78471
|
+
} else {
|
|
78472
|
+
y = -drawNode.dHeight - 4;
|
|
78473
|
+
scaleY = (drawNode.dHeight - drawNode._drawDate.getMeasuredHeight() - 2) / hitHeight;
|
|
78474
|
+
}
|
|
78463
78475
|
}
|
|
78464
|
-
|
|
78465
|
-
bitmap.setTransform(x, y, width / hitWidth, scaleY);
|
|
78466
|
-
} else {
|
|
78467
|
-
bitmap.setTransform(0, -drawNode.dHeight, width / hitWidth, drawNode.dHeight / hitHeight);
|
|
78468
|
-
}
|
|
78469
|
-
var hitArea = new createjs.Shape();
|
|
78470
|
-
hitArea.graphics.beginFill('#000').drawRect(0, 0, drawNode.dWidth, drawNode.dHeight); //这里是图片大小
|
|
78471
|
-
bitmap.hitArea = hitArea;
|
|
78472
|
-
// if (this.attribute !== 4) {
|
|
78473
|
-
// if (this.imgSrc.indexOf('data:image/') != -1 && this.imgSrc.indexOf('data:image/png') == -1) {
|
|
78474
|
-
// const canvas = document.createElement('canvas');
|
|
78475
|
-
// canvas.width = image.naturalWidth;
|
|
78476
|
-
// canvas.height = image.naturalHeight;
|
|
78477
|
-
// const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;
|
|
78478
|
-
// ctx.fillStyle = '#FFFFFF';
|
|
78479
|
-
// ctx.fillRect(0, 0, image.naturalWidth, image.naturalHeight);
|
|
78480
|
-
// ctx.drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight);
|
|
78481
|
-
// (this.node as SignNode).imgSrc = canvas.toDataURL('image/png');
|
|
78482
|
-
// }
|
|
78483
|
-
// }
|
|
78484
|
-
var dArea = hoEditorFactory.drawPageTree.getMainRootArea(drawNode);
|
|
78485
|
-
if (dArea) {
|
|
78486
|
-
var atype = hoEditorFactory.subDocManger.getHeaderFooterType(_this3.node.getNodePath());
|
|
78487
|
-
if (atype === _editor_SubDocManger__WEBPACK_IMPORTED_MODULE_9__/* .HeaderFooterType.hftHead */ .pi.hftHead && dArea != hoEditorFactory.drawTree.drawPages[dArea.index].drawHeader) {
|
|
78488
|
-
hoEditorFactory.subDocManger.copySubDocToPages(dArea, dArea.index, atype);
|
|
78476
|
+
bitmap.setTransform(x, y, width / hitWidth, scaleY);
|
|
78489
78477
|
} else {
|
|
78490
|
-
|
|
78478
|
+
bitmap.setTransform(0, -drawNode.dHeight, width / hitWidth, drawNode.dHeight / hitHeight);
|
|
78479
|
+
}
|
|
78480
|
+
var hitArea = new createjs.Shape();
|
|
78481
|
+
hitArea.graphics.beginFill('#000').drawRect(0, 0, drawNode.dWidth, drawNode.dHeight); //这里是图片大小
|
|
78482
|
+
bitmap.hitArea = hitArea;
|
|
78483
|
+
var dArea = hoEditorFactory.drawPageTree.getMainRootArea(drawNode);
|
|
78484
|
+
if (dArea) {
|
|
78485
|
+
var atype = hoEditorFactory.subDocManger.getHeaderFooterType(_this3.node.getNodePath());
|
|
78486
|
+
if (atype === _editor_SubDocManger__WEBPACK_IMPORTED_MODULE_9__/* .HeaderFooterType.hftHead */ .pi.hftHead && dArea != hoEditorFactory.drawTree.drawPages[dArea.index].drawHeader) {
|
|
78491
78487
|
hoEditorFactory.subDocManger.copySubDocToPages(dArea, dArea.index, atype);
|
|
78488
|
+
} else {
|
|
78489
|
+
if (atype === _editor_SubDocManger__WEBPACK_IMPORTED_MODULE_9__/* .HeaderFooterType.hftFoot */ .pi.hftFoot && dArea != hoEditorFactory.drawTree.drawPages[dArea.index].drawFooter) {
|
|
78490
|
+
hoEditorFactory.subDocManger.copySubDocToPages(dArea, dArea.index, atype);
|
|
78491
|
+
}
|
|
78492
78492
|
}
|
|
78493
|
+
hoEditorFactory.drawPageTree.updateDrawPage(dArea.index);
|
|
78493
78494
|
}
|
|
78494
|
-
hoEditorFactory.
|
|
78495
|
+
hoEditorFactory.loadImageCount--;
|
|
78496
|
+
};
|
|
78497
|
+
// if(this.imgSrc.includes("data:image/")) {
|
|
78498
|
+
// handleOrientation();
|
|
78499
|
+
// } else {
|
|
78500
|
+
// console.log("--------------++++++++++++++++======================")
|
|
78501
|
+
if (!_this3._exif) {
|
|
78502
|
+
_this3._exif = __webpack_require__(29794);
|
|
78503
|
+
}
|
|
78504
|
+
if (_this3._exif) {
|
|
78505
|
+
_this3._exif.getData(image, function (exifdata) {
|
|
78506
|
+
image.exifdata = exifdata;
|
|
78507
|
+
handleOrientation();
|
|
78508
|
+
});
|
|
78495
78509
|
}
|
|
78496
|
-
|
|
78510
|
+
// }
|
|
78497
78511
|
};
|
|
78512
|
+
|
|
78498
78513
|
image.onerror = function () {
|
|
78499
78514
|
return hoEditorFactory.loadImageCount--;
|
|
78500
78515
|
};
|
|
@@ -89466,13 +89481,13 @@ var NodesDeleteUndoUnit = /*#__PURE__*/function () {
|
|
|
89466
89481
|
// }
|
|
89467
89482
|
//if(nodes.length == 0) return;
|
|
89468
89483
|
if (!(hoEditorFactory.drawTree.paintStatus !== _draw_drawTree_DrawTree__WEBPACK_IMPORTED_MODULE_17__/* .PaintState.psDesign */ .Dh.psDesign && !this._isForceDelete)) {
|
|
89469
|
-
_context2.next =
|
|
89484
|
+
_context2.next = 41;
|
|
89470
89485
|
break;
|
|
89471
89486
|
}
|
|
89472
89487
|
n = 0;
|
|
89473
89488
|
case 14:
|
|
89474
89489
|
if (!(n < nodes.length)) {
|
|
89475
|
-
_context2.next =
|
|
89490
|
+
_context2.next = 40;
|
|
89476
89491
|
break;
|
|
89477
89492
|
}
|
|
89478
89493
|
node = nodes[n]; // if (node instanceof MarkNode && node.parentNode instanceof TextInputFieldNode && node.MarkNodeType === 1 && !node.parentNode.isAllowDelete) {
|
|
@@ -89481,11 +89496,11 @@ var NodesDeleteUndoUnit = /*#__PURE__*/function () {
|
|
|
89481
89496
|
// return;
|
|
89482
89497
|
// }
|
|
89483
89498
|
if (!(node instanceof _dom_treeNode_ControlNode__WEBPACK_IMPORTED_MODULE_30__/* .ControlNode */ .w || node instanceof _dom_treeNode_TextInputFieldNode__WEBPACK_IMPORTED_MODULE_22__/* .TextInputFieldNode */ .re)) {
|
|
89484
|
-
_context2.next =
|
|
89499
|
+
_context2.next = 27;
|
|
89485
89500
|
break;
|
|
89486
89501
|
}
|
|
89487
89502
|
if (node.isAllowDelete) {
|
|
89488
|
-
_context2.next =
|
|
89503
|
+
_context2.next = 27;
|
|
89489
89504
|
break;
|
|
89490
89505
|
}
|
|
89491
89506
|
tip = "";
|
|
@@ -89501,37 +89516,40 @@ var NodesDeleteUndoUnit = /*#__PURE__*/function () {
|
|
|
89501
89516
|
if (node instanceof _dom_treeNode_DownListNode__WEBPACK_IMPORTED_MODULE_33__/* .DownListNode */ .yF) {
|
|
89502
89517
|
tip = "下拉列表";
|
|
89503
89518
|
}
|
|
89519
|
+
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_40__/* ["default"].destroy */ .Z.destroy();
|
|
89504
89520
|
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_40__/* ["default"].warn */ .Z.warn(tip + "元素已设置为不允许删除。请先右键元素属性设置成允许删除,再进行删除操作。");
|
|
89505
89521
|
this._isError = true;
|
|
89506
89522
|
return _context2.abrupt("return");
|
|
89507
|
-
case
|
|
89523
|
+
case 27:
|
|
89508
89524
|
if (!(node instanceof _dom_treeNode_TableFormula__WEBPACK_IMPORTED_MODULE_37__/* .TableFormula */ .N)) {
|
|
89509
|
-
_context2.next =
|
|
89525
|
+
_context2.next = 32;
|
|
89510
89526
|
break;
|
|
89511
89527
|
}
|
|
89528
|
+
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_40__/* ["default"].destroy */ .Z.destroy();
|
|
89512
89529
|
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_40__/* ["default"].warn */ .Z.warn("不允许删除表格计算公式");
|
|
89513
89530
|
this._isError = true;
|
|
89514
89531
|
return _context2.abrupt("return");
|
|
89515
|
-
case
|
|
89532
|
+
case 32:
|
|
89516
89533
|
if (!(node instanceof _dom_treeNode_SignNode__WEBPACK_IMPORTED_MODULE_35__/* .SignNode */ .N && node.isTemplate && node.number === 0)) {
|
|
89517
|
-
_context2.next =
|
|
89534
|
+
_context2.next = 37;
|
|
89518
89535
|
break;
|
|
89519
89536
|
}
|
|
89537
|
+
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_40__/* ["default"].destroy */ .Z.destroy();
|
|
89520
89538
|
ant_design_vue_es_message__WEBPACK_IMPORTED_MODULE_40__/* ["default"].warn */ .Z.warn("该签名元素不允许删除!");
|
|
89521
89539
|
this._isError = true;
|
|
89522
89540
|
return _context2.abrupt("return");
|
|
89523
|
-
case
|
|
89541
|
+
case 37:
|
|
89524
89542
|
n++;
|
|
89525
89543
|
_context2.next = 14;
|
|
89526
89544
|
break;
|
|
89527
|
-
case
|
|
89545
|
+
case 40:
|
|
89528
89546
|
if (nodes.length === 1 && nodes[0] instanceof _dom_treeNode_TextInputFieldNode__WEBPACK_IMPORTED_MODULE_22__/* .TextInputFieldNode */ .re && !nodes[0].isAllowDelete && nodes[0].childNodes[1] instanceof _dom_treeNode_MarkNode__WEBPACK_IMPORTED_MODULE_23__/* .MarkNode */ .j) {
|
|
89529
89547
|
hoEditorFactory.docTree.curDomRange.setSamePath(this._endPath);
|
|
89530
89548
|
}
|
|
89531
|
-
case
|
|
89549
|
+
case 41:
|
|
89532
89550
|
pnode = (_currRange$npEnd$node = currRange.npEnd.node) === null || _currRange$npEnd$node === void 0 ? void 0 : _currRange$npEnd$node.parentNode;
|
|
89533
89551
|
if (!(pnode && pnode instanceof _dom_treeNode_TextInputFieldNode__WEBPACK_IMPORTED_MODULE_22__/* .TextInputFieldNode */ .re && currRange.npEnd.path != hoEditorFactory.docTree.getNodeLastPath(pnode))) {
|
|
89534
|
-
_context2.next =
|
|
89552
|
+
_context2.next = 47;
|
|
89535
89553
|
break;
|
|
89536
89554
|
}
|
|
89537
89555
|
//判断当前TextInputField是否可编辑
|
|
@@ -89543,19 +89561,19 @@ var NodesDeleteUndoUnit = /*#__PURE__*/function () {
|
|
|
89543
89561
|
// this._undo.commit();
|
|
89544
89562
|
});
|
|
89545
89563
|
if (_res[0]) {
|
|
89546
|
-
_context2.next =
|
|
89564
|
+
_context2.next = 47;
|
|
89547
89565
|
break;
|
|
89548
89566
|
}
|
|
89549
89567
|
return _context2.abrupt("return");
|
|
89550
|
-
case
|
|
89568
|
+
case 47:
|
|
89551
89569
|
changeEvent = new _events_NodeChangeEvent__WEBPACK_IMPORTED_MODULE_16__/* .NodeChangeEvent */ .G(this._hoEditorFactoryID, _editor_dom_DocTree__WEBPACK_IMPORTED_MODULE_14__/* .DocAction.daUndoInsert */ .gk.daUndoInsert, currRange.startPath, ""); //FIXME:deleteRange函数完成后调用这个
|
|
89552
89570
|
// hoEditorFactory.docTree.deleteRange(arange.startPath, arange.endPath);
|
|
89553
89571
|
if (currRange.npStart.node && currRange.npEnd.node) {
|
|
89554
|
-
_context2.next =
|
|
89572
|
+
_context2.next = 50;
|
|
89555
89573
|
break;
|
|
89556
89574
|
}
|
|
89557
89575
|
throw _events_Exception__WEBPACK_IMPORTED_MODULE_24__/* .Exception.NodeNotFound */ .P.NodeNotFound();
|
|
89558
|
-
case
|
|
89576
|
+
case 50:
|
|
89559
89577
|
// const [startPath, endPath] = DomRange.skipStartEndTablePath(
|
|
89560
89578
|
// this._hoEditorFactory,
|
|
89561
89579
|
// currRange.startPath,
|
|
@@ -89567,17 +89585,17 @@ var NodesDeleteUndoUnit = /*#__PURE__*/function () {
|
|
|
89567
89585
|
changeEvent.oldDrawTreeLines = new _draw_SelectRange__WEBPACK_IMPORTED_MODULE_27__/* .SelectRange */ .E(this._hoEditorFactoryID).getRangeDrawTreeLines(startPath, endPath);
|
|
89568
89586
|
res = this.deleteRange(currRange.endPath, currRange.startPath);
|
|
89569
89587
|
if (!(res == 1)) {
|
|
89570
|
-
_context2.next =
|
|
89588
|
+
_context2.next = 62;
|
|
89571
89589
|
break;
|
|
89572
89590
|
}
|
|
89573
89591
|
changeEvent.beforeChangePath = startPath;
|
|
89574
89592
|
changeEvent.afterChangePath = this._tmp.start;
|
|
89575
|
-
_context2.next =
|
|
89593
|
+
_context2.next = 60;
|
|
89576
89594
|
return hoEditorFactory.docTree.change(changeEvent);
|
|
89577
|
-
case
|
|
89595
|
+
case 60:
|
|
89578
89596
|
cgEvent = new _events_SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_20__/* .SelectionChangeEvent */ .r(hoEditorFactory.docTree.curDomRange, new _dom_DomRange__WEBPACK_IMPORTED_MODULE_18__/* .DomRange */ .a(this._hoEditorFactoryID, this._tmp.start, this._tmp.start));
|
|
89579
89597
|
hoEditorFactory.docTree.selectChange(cgEvent);
|
|
89580
|
-
case
|
|
89598
|
+
case 62:
|
|
89581
89599
|
hoEditorFactory.docTree.curDomRange.setSamePath(this._tmp.start);
|
|
89582
89600
|
hoEditorFactory.drawTree.moveCaretToPath(this._tmp.start);
|
|
89583
89601
|
aNode = currRange.npStart.node;
|
|
@@ -89585,12 +89603,12 @@ var NodesDeleteUndoUnit = /*#__PURE__*/function () {
|
|
|
89585
89603
|
pnode = aNode.parentNode;
|
|
89586
89604
|
}
|
|
89587
89605
|
if (!(aNode && pnode)) {
|
|
89588
|
-
_context2.next =
|
|
89606
|
+
_context2.next = 69;
|
|
89589
89607
|
break;
|
|
89590
89608
|
}
|
|
89591
|
-
_context2.next =
|
|
89609
|
+
_context2.next = 69;
|
|
89592
89610
|
return this.ParentRepaint(pnode);
|
|
89593
|
-
case
|
|
89611
|
+
case 69:
|
|
89594
89612
|
case "end":
|
|
89595
89613
|
return _context2.stop();
|
|
89596
89614
|
}
|
|
@@ -93834,6 +93852,1094 @@ __webpack_require__(25994);
|
|
|
93834
93852
|
|
|
93835
93853
|
/***/ }),
|
|
93836
93854
|
|
|
93855
|
+
/***/ 29794:
|
|
93856
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
93857
|
+
|
|
93858
|
+
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;__webpack_require__(74916);
|
|
93859
|
+
__webpack_require__(4723);
|
|
93860
|
+
__webpack_require__(15306);
|
|
93861
|
+
__webpack_require__(75505);
|
|
93862
|
+
__webpack_require__(87714);
|
|
93863
|
+
__webpack_require__(82801);
|
|
93864
|
+
__webpack_require__(1174);
|
|
93865
|
+
__webpack_require__(18264);
|
|
93866
|
+
__webpack_require__(39575);
|
|
93867
|
+
__webpack_require__(41539);
|
|
93868
|
+
__webpack_require__(66992);
|
|
93869
|
+
__webpack_require__(82472);
|
|
93870
|
+
__webpack_require__(48675);
|
|
93871
|
+
__webpack_require__(92990);
|
|
93872
|
+
__webpack_require__(18927);
|
|
93873
|
+
__webpack_require__(33105);
|
|
93874
|
+
__webpack_require__(35035);
|
|
93875
|
+
__webpack_require__(74345);
|
|
93876
|
+
__webpack_require__(7174);
|
|
93877
|
+
__webpack_require__(63408);
|
|
93878
|
+
__webpack_require__(14590);
|
|
93879
|
+
__webpack_require__(32846);
|
|
93880
|
+
__webpack_require__(44731);
|
|
93881
|
+
__webpack_require__(77209);
|
|
93882
|
+
__webpack_require__(96319);
|
|
93883
|
+
__webpack_require__(58867);
|
|
93884
|
+
__webpack_require__(37789);
|
|
93885
|
+
__webpack_require__(33739);
|
|
93886
|
+
__webpack_require__(29368);
|
|
93887
|
+
__webpack_require__(14483);
|
|
93888
|
+
__webpack_require__(12056);
|
|
93889
|
+
__webpack_require__(3462);
|
|
93890
|
+
__webpack_require__(30678);
|
|
93891
|
+
__webpack_require__(27462);
|
|
93892
|
+
__webpack_require__(33824);
|
|
93893
|
+
__webpack_require__(55021);
|
|
93894
|
+
__webpack_require__(12974);
|
|
93895
|
+
__webpack_require__(15016);
|
|
93896
|
+
__webpack_require__(77601);
|
|
93897
|
+
__webpack_require__(9653);
|
|
93898
|
+
(function () {
|
|
93899
|
+
var debug = false;
|
|
93900
|
+
var root = this;
|
|
93901
|
+
var EXIF = function EXIF(obj) {
|
|
93902
|
+
if (obj instanceof EXIF) return obj;
|
|
93903
|
+
if (!(this instanceof EXIF)) return new EXIF(obj);
|
|
93904
|
+
this.EXIFwrapped = obj;
|
|
93905
|
+
};
|
|
93906
|
+
if (true) {
|
|
93907
|
+
if ( true && module.exports) {
|
|
93908
|
+
exports = module.exports = EXIF;
|
|
93909
|
+
}
|
|
93910
|
+
exports.EXIF = EXIF;
|
|
93911
|
+
} else {}
|
|
93912
|
+
var ExifTags = EXIF.Tags = {
|
|
93913
|
+
// version tags
|
|
93914
|
+
0x9000: 'ExifVersion',
|
|
93915
|
+
// EXIF version
|
|
93916
|
+
0xa000: 'FlashpixVersion',
|
|
93917
|
+
// Flashpix format version
|
|
93918
|
+
|
|
93919
|
+
// colorspace tags
|
|
93920
|
+
0xa001: 'ColorSpace',
|
|
93921
|
+
// Color space information tag
|
|
93922
|
+
|
|
93923
|
+
// image configuration
|
|
93924
|
+
0xa002: 'PixelXDimension',
|
|
93925
|
+
// Valid width of meaningful image
|
|
93926
|
+
0xa003: 'PixelYDimension',
|
|
93927
|
+
// Valid height of meaningful image
|
|
93928
|
+
0x9101: 'ComponentsConfiguration',
|
|
93929
|
+
// Information about channels
|
|
93930
|
+
0x9102: 'CompressedBitsPerPixel',
|
|
93931
|
+
// Compressed bits per pixel
|
|
93932
|
+
|
|
93933
|
+
// user information
|
|
93934
|
+
0x927c: 'MakerNote',
|
|
93935
|
+
// Any desired information written by the manufacturer
|
|
93936
|
+
0x9286: 'UserComment',
|
|
93937
|
+
// Comments by user
|
|
93938
|
+
|
|
93939
|
+
// related file
|
|
93940
|
+
0xa004: 'RelatedSoundFile',
|
|
93941
|
+
// Name of related sound file
|
|
93942
|
+
|
|
93943
|
+
// date and time
|
|
93944
|
+
0x9003: 'DateTimeOriginal',
|
|
93945
|
+
// Date and time when the original image was generated
|
|
93946
|
+
0x9004: 'DateTimeDigitized',
|
|
93947
|
+
// Date and time when the image was stored digitally
|
|
93948
|
+
0x9290: 'SubsecTime',
|
|
93949
|
+
// Fractions of seconds for DateTime
|
|
93950
|
+
0x9291: 'SubsecTimeOriginal',
|
|
93951
|
+
// Fractions of seconds for DateTimeOriginal
|
|
93952
|
+
0x9292: 'SubsecTimeDigitized',
|
|
93953
|
+
// Fractions of seconds for DateTimeDigitized
|
|
93954
|
+
|
|
93955
|
+
// picture-taking conditions
|
|
93956
|
+
0x829a: 'ExposureTime',
|
|
93957
|
+
// Exposure time (in seconds)
|
|
93958
|
+
0x829d: 'FNumber',
|
|
93959
|
+
// F number
|
|
93960
|
+
0x8822: 'ExposureProgram',
|
|
93961
|
+
// Exposure program
|
|
93962
|
+
0x8824: 'SpectralSensitivity',
|
|
93963
|
+
// Spectral sensitivity
|
|
93964
|
+
0x8827: 'ISOSpeedRatings',
|
|
93965
|
+
// ISO speed rating
|
|
93966
|
+
0x8828: 'OECF',
|
|
93967
|
+
// Optoelectric conversion factor
|
|
93968
|
+
0x9201: 'ShutterSpeedValue',
|
|
93969
|
+
// Shutter speed
|
|
93970
|
+
0x9202: 'ApertureValue',
|
|
93971
|
+
// Lens aperture
|
|
93972
|
+
0x9203: 'BrightnessValue',
|
|
93973
|
+
// Value of brightness
|
|
93974
|
+
0x9204: 'ExposureBias',
|
|
93975
|
+
// Exposure bias
|
|
93976
|
+
0x9205: 'MaxApertureValue',
|
|
93977
|
+
// Smallest F number of lens
|
|
93978
|
+
0x9206: 'SubjectDistance',
|
|
93979
|
+
// Distance to subject in meters
|
|
93980
|
+
0x9207: 'MeteringMode',
|
|
93981
|
+
// Metering mode
|
|
93982
|
+
0x9208: 'LightSource',
|
|
93983
|
+
// Kind of light source
|
|
93984
|
+
0x9209: 'Flash',
|
|
93985
|
+
// Flash status
|
|
93986
|
+
0x9214: 'SubjectArea',
|
|
93987
|
+
// Location and area of main subject
|
|
93988
|
+
0x920a: 'FocalLength',
|
|
93989
|
+
// Focal length of the lens in mm
|
|
93990
|
+
0xa20b: 'FlashEnergy',
|
|
93991
|
+
// Strobe energy in BCPS
|
|
93992
|
+
0xa20c: 'SpatialFrequencyResponse',
|
|
93993
|
+
//
|
|
93994
|
+
0xa20e: 'FocalPlaneXResolution',
|
|
93995
|
+
// Number of pixels in width direction per FocalPlaneResolutionUnit
|
|
93996
|
+
0xa20f: 'FocalPlaneYResolution',
|
|
93997
|
+
// Number of pixels in height direction per FocalPlaneResolutionUnit
|
|
93998
|
+
0xa210: 'FocalPlaneResolutionUnit',
|
|
93999
|
+
// Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution
|
|
94000
|
+
0xa214: 'SubjectLocation',
|
|
94001
|
+
// Location of subject in image
|
|
94002
|
+
0xa215: 'ExposureIndex',
|
|
94003
|
+
// Exposure index selected on camera
|
|
94004
|
+
0xa217: 'SensingMethod',
|
|
94005
|
+
// Image sensor type
|
|
94006
|
+
0xa300: 'FileSource',
|
|
94007
|
+
// Image source (3 == DSC)
|
|
94008
|
+
0xa301: 'SceneType',
|
|
94009
|
+
// Scene type (1 == directly photographed)
|
|
94010
|
+
0xa302: 'CFAPattern',
|
|
94011
|
+
// Color filter array geometric pattern
|
|
94012
|
+
0xa401: 'CustomRendered',
|
|
94013
|
+
// Special processing
|
|
94014
|
+
0xa402: 'ExposureMode',
|
|
94015
|
+
// Exposure mode
|
|
94016
|
+
0xa403: 'WhiteBalance',
|
|
94017
|
+
// 1 = auto white balance, 2 = manual
|
|
94018
|
+
0xa404: 'DigitalZoomRation',
|
|
94019
|
+
// Digital zoom ratio
|
|
94020
|
+
0xa405: 'FocalLengthIn35mmFilm',
|
|
94021
|
+
// Equivalent foacl length assuming 35mm film camera (in mm)
|
|
94022
|
+
0xa406: 'SceneCaptureType',
|
|
94023
|
+
// Type of scene
|
|
94024
|
+
0xa407: 'GainControl',
|
|
94025
|
+
// Degree of overall image gain adjustment
|
|
94026
|
+
0xa408: 'Contrast',
|
|
94027
|
+
// Direction of contrast processing applied by camera
|
|
94028
|
+
0xa409: 'Saturation',
|
|
94029
|
+
// Direction of saturation processing applied by camera
|
|
94030
|
+
0xa40a: 'Sharpness',
|
|
94031
|
+
// Direction of sharpness processing applied by camera
|
|
94032
|
+
0xa40b: 'DeviceSettingDescription',
|
|
94033
|
+
//
|
|
94034
|
+
0xa40c: 'SubjectDistanceRange',
|
|
94035
|
+
// Distance to subject
|
|
94036
|
+
|
|
94037
|
+
// other tags
|
|
94038
|
+
0xa005: 'InteroperabilityIFDPointer',
|
|
94039
|
+
0xa420: 'ImageUniqueID' // Identifier assigned uniquely to each image
|
|
94040
|
+
};
|
|
94041
|
+
|
|
94042
|
+
var TiffTags = EXIF.TiffTags = {
|
|
94043
|
+
0x0100: 'ImageWidth',
|
|
94044
|
+
0x0101: 'ImageHeight',
|
|
94045
|
+
0x8769: 'ExifIFDPointer',
|
|
94046
|
+
0x8825: 'GPSInfoIFDPointer',
|
|
94047
|
+
0xa005: 'InteroperabilityIFDPointer',
|
|
94048
|
+
0x0102: 'BitsPerSample',
|
|
94049
|
+
0x0103: 'Compression',
|
|
94050
|
+
0x0106: 'PhotometricInterpretation',
|
|
94051
|
+
0x0112: 'Orientation',
|
|
94052
|
+
0x0115: 'SamplesPerPixel',
|
|
94053
|
+
0x011c: 'PlanarConfiguration',
|
|
94054
|
+
0x0212: 'YCbCrSubSampling',
|
|
94055
|
+
0x0213: 'YCbCrPositioning',
|
|
94056
|
+
0x011a: 'XResolution',
|
|
94057
|
+
0x011b: 'YResolution',
|
|
94058
|
+
0x0128: 'ResolutionUnit',
|
|
94059
|
+
0x0111: 'StripOffsets',
|
|
94060
|
+
0x0116: 'RowsPerStrip',
|
|
94061
|
+
0x0117: 'StripByteCounts',
|
|
94062
|
+
0x0201: 'JPEGInterchangeFormat',
|
|
94063
|
+
0x0202: 'JPEGInterchangeFormatLength',
|
|
94064
|
+
0x012d: 'TransferFunction',
|
|
94065
|
+
0x013e: 'WhitePoint',
|
|
94066
|
+
0x013f: 'PrimaryChromaticities',
|
|
94067
|
+
0x0211: 'YCbCrCoefficients',
|
|
94068
|
+
0x0214: 'ReferenceBlackWhite',
|
|
94069
|
+
0x0132: 'DateTime',
|
|
94070
|
+
0x010e: 'ImageDescription',
|
|
94071
|
+
0x010f: 'Make',
|
|
94072
|
+
0x0110: 'Model',
|
|
94073
|
+
0x0131: 'Software',
|
|
94074
|
+
0x013b: 'Artist',
|
|
94075
|
+
0x8298: 'Copyright'
|
|
94076
|
+
};
|
|
94077
|
+
var GPSTags = EXIF.GPSTags = {
|
|
94078
|
+
0x0000: 'GPSVersionID',
|
|
94079
|
+
0x0001: 'GPSLatitudeRef',
|
|
94080
|
+
0x0002: 'GPSLatitude',
|
|
94081
|
+
0x0003: 'GPSLongitudeRef',
|
|
94082
|
+
0x0004: 'GPSLongitude',
|
|
94083
|
+
0x0005: 'GPSAltitudeRef',
|
|
94084
|
+
0x0006: 'GPSAltitude',
|
|
94085
|
+
0x0007: 'GPSTimeStamp',
|
|
94086
|
+
0x0008: 'GPSSatellites',
|
|
94087
|
+
0x0009: 'GPSStatus',
|
|
94088
|
+
0x000a: 'GPSMeasureMode',
|
|
94089
|
+
0x000b: 'GPSDOP',
|
|
94090
|
+
0x000c: 'GPSSpeedRef',
|
|
94091
|
+
0x000d: 'GPSSpeed',
|
|
94092
|
+
0x000e: 'GPSTrackRef',
|
|
94093
|
+
0x000f: 'GPSTrack',
|
|
94094
|
+
0x0010: 'GPSImgDirectionRef',
|
|
94095
|
+
0x0011: 'GPSImgDirection',
|
|
94096
|
+
0x0012: 'GPSMapDatum',
|
|
94097
|
+
0x0013: 'GPSDestLatitudeRef',
|
|
94098
|
+
0x0014: 'GPSDestLatitude',
|
|
94099
|
+
0x0015: 'GPSDestLongitudeRef',
|
|
94100
|
+
0x0016: 'GPSDestLongitude',
|
|
94101
|
+
0x0017: 'GPSDestBearingRef',
|
|
94102
|
+
0x0018: 'GPSDestBearing',
|
|
94103
|
+
0x0019: 'GPSDestDistanceRef',
|
|
94104
|
+
0x001a: 'GPSDestDistance',
|
|
94105
|
+
0x001b: 'GPSProcessingMethod',
|
|
94106
|
+
0x001c: 'GPSAreaInformation',
|
|
94107
|
+
0x001d: 'GPSDateStamp',
|
|
94108
|
+
0x001e: 'GPSDifferential'
|
|
94109
|
+
};
|
|
94110
|
+
|
|
94111
|
+
// EXIF 2.3 Spec
|
|
94112
|
+
var IFD1Tags = EXIF.IFD1Tags = {
|
|
94113
|
+
0x0100: 'ImageWidth',
|
|
94114
|
+
0x0101: 'ImageHeight',
|
|
94115
|
+
0x0102: 'BitsPerSample',
|
|
94116
|
+
0x0103: 'Compression',
|
|
94117
|
+
0x0106: 'PhotometricInterpretation',
|
|
94118
|
+
0x0111: 'StripOffsets',
|
|
94119
|
+
0x0112: 'Orientation',
|
|
94120
|
+
0x0115: 'SamplesPerPixel',
|
|
94121
|
+
0x0116: 'RowsPerStrip',
|
|
94122
|
+
0x0117: 'StripByteCounts',
|
|
94123
|
+
0x011a: 'XResolution',
|
|
94124
|
+
0x011b: 'YResolution',
|
|
94125
|
+
0x011c: 'PlanarConfiguration',
|
|
94126
|
+
0x0128: 'ResolutionUnit',
|
|
94127
|
+
0x0201: 'JpegIFOffset',
|
|
94128
|
+
// When image format is JPEG, this value show offset to JPEG data stored.(aka "ThumbnailOffset" or "JPEGInterchangeFormat")
|
|
94129
|
+
0x0202: 'JpegIFByteCount',
|
|
94130
|
+
// When image format is JPEG, this value shows data size of JPEG image (aka "ThumbnailLength" or "JPEGInterchangeFormatLength")
|
|
94131
|
+
0x0211: 'YCbCrCoefficients',
|
|
94132
|
+
0x0212: 'YCbCrSubSampling',
|
|
94133
|
+
0x0213: 'YCbCrPositioning',
|
|
94134
|
+
0x0214: 'ReferenceBlackWhite'
|
|
94135
|
+
};
|
|
94136
|
+
var StringValues = EXIF.StringValues = {
|
|
94137
|
+
ExposureProgram: {
|
|
94138
|
+
0: 'Not defined',
|
|
94139
|
+
1: 'Manual',
|
|
94140
|
+
2: 'Normal program',
|
|
94141
|
+
3: 'Aperture priority',
|
|
94142
|
+
4: 'Shutter priority',
|
|
94143
|
+
5: 'Creative program',
|
|
94144
|
+
6: 'Action program',
|
|
94145
|
+
7: 'Portrait mode',
|
|
94146
|
+
8: 'Landscape mode'
|
|
94147
|
+
},
|
|
94148
|
+
MeteringMode: {
|
|
94149
|
+
0: 'Unknown',
|
|
94150
|
+
1: 'Average',
|
|
94151
|
+
2: 'CenterWeightedAverage',
|
|
94152
|
+
3: 'Spot',
|
|
94153
|
+
4: 'MultiSpot',
|
|
94154
|
+
5: 'Pattern',
|
|
94155
|
+
6: 'Partial',
|
|
94156
|
+
255: 'Other'
|
|
94157
|
+
},
|
|
94158
|
+
LightSource: {
|
|
94159
|
+
0: 'Unknown',
|
|
94160
|
+
1: 'Daylight',
|
|
94161
|
+
2: 'Fluorescent',
|
|
94162
|
+
3: 'Tungsten (incandescent light)',
|
|
94163
|
+
4: 'Flash',
|
|
94164
|
+
9: 'Fine weather',
|
|
94165
|
+
10: 'Cloudy weather',
|
|
94166
|
+
11: 'Shade',
|
|
94167
|
+
12: 'Daylight fluorescent (D 5700 - 7100K)',
|
|
94168
|
+
13: 'Day white fluorescent (N 4600 - 5400K)',
|
|
94169
|
+
14: 'Cool white fluorescent (W 3900 - 4500K)',
|
|
94170
|
+
15: 'White fluorescent (WW 3200 - 3700K)',
|
|
94171
|
+
17: 'Standard light A',
|
|
94172
|
+
18: 'Standard light B',
|
|
94173
|
+
19: 'Standard light C',
|
|
94174
|
+
20: 'D55',
|
|
94175
|
+
21: 'D65',
|
|
94176
|
+
22: 'D75',
|
|
94177
|
+
23: 'D50',
|
|
94178
|
+
24: 'ISO studio tungsten',
|
|
94179
|
+
255: 'Other'
|
|
94180
|
+
},
|
|
94181
|
+
Flash: {
|
|
94182
|
+
0x0000: 'Flash did not fire',
|
|
94183
|
+
0x0001: 'Flash fired',
|
|
94184
|
+
0x0005: 'Strobe return light not detected',
|
|
94185
|
+
0x0007: 'Strobe return light detected',
|
|
94186
|
+
0x0009: 'Flash fired, compulsory flash mode',
|
|
94187
|
+
0x000d: 'Flash fired, compulsory flash mode, return light not detected',
|
|
94188
|
+
0x000f: 'Flash fired, compulsory flash mode, return light detected',
|
|
94189
|
+
0x0010: 'Flash did not fire, compulsory flash mode',
|
|
94190
|
+
0x0018: 'Flash did not fire, auto mode',
|
|
94191
|
+
0x0019: 'Flash fired, auto mode',
|
|
94192
|
+
0x001d: 'Flash fired, auto mode, return light not detected',
|
|
94193
|
+
0x001f: 'Flash fired, auto mode, return light detected',
|
|
94194
|
+
0x0020: 'No flash function',
|
|
94195
|
+
0x0041: 'Flash fired, red-eye reduction mode',
|
|
94196
|
+
0x0045: 'Flash fired, red-eye reduction mode, return light not detected',
|
|
94197
|
+
0x0047: 'Flash fired, red-eye reduction mode, return light detected',
|
|
94198
|
+
0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode',
|
|
94199
|
+
0x004d: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',
|
|
94200
|
+
0x004f: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',
|
|
94201
|
+
0x0059: 'Flash fired, auto mode, red-eye reduction mode',
|
|
94202
|
+
0x005d: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',
|
|
94203
|
+
0x005f: 'Flash fired, auto mode, return light detected, red-eye reduction mode'
|
|
94204
|
+
},
|
|
94205
|
+
SensingMethod: {
|
|
94206
|
+
1: 'Not defined',
|
|
94207
|
+
2: 'One-chip color area sensor',
|
|
94208
|
+
3: 'Two-chip color area sensor',
|
|
94209
|
+
4: 'Three-chip color area sensor',
|
|
94210
|
+
5: 'Color sequential area sensor',
|
|
94211
|
+
7: 'Trilinear sensor',
|
|
94212
|
+
8: 'Color sequential linear sensor'
|
|
94213
|
+
},
|
|
94214
|
+
SceneCaptureType: {
|
|
94215
|
+
0: 'Standard',
|
|
94216
|
+
1: 'Landscape',
|
|
94217
|
+
2: 'Portrait',
|
|
94218
|
+
3: 'Night scene'
|
|
94219
|
+
},
|
|
94220
|
+
SceneType: {
|
|
94221
|
+
1: 'Directly photographed'
|
|
94222
|
+
},
|
|
94223
|
+
CustomRendered: {
|
|
94224
|
+
0: 'Normal process',
|
|
94225
|
+
1: 'Custom process'
|
|
94226
|
+
},
|
|
94227
|
+
WhiteBalance: {
|
|
94228
|
+
0: 'Auto white balance',
|
|
94229
|
+
1: 'Manual white balance'
|
|
94230
|
+
},
|
|
94231
|
+
GainControl: {
|
|
94232
|
+
0: 'None',
|
|
94233
|
+
1: 'Low gain up',
|
|
94234
|
+
2: 'High gain up',
|
|
94235
|
+
3: 'Low gain down',
|
|
94236
|
+
4: 'High gain down'
|
|
94237
|
+
},
|
|
94238
|
+
Contrast: {
|
|
94239
|
+
0: 'Normal',
|
|
94240
|
+
1: 'Soft',
|
|
94241
|
+
2: 'Hard'
|
|
94242
|
+
},
|
|
94243
|
+
Saturation: {
|
|
94244
|
+
0: 'Normal',
|
|
94245
|
+
1: 'Low saturation',
|
|
94246
|
+
2: 'High saturation'
|
|
94247
|
+
},
|
|
94248
|
+
Sharpness: {
|
|
94249
|
+
0: 'Normal',
|
|
94250
|
+
1: 'Soft',
|
|
94251
|
+
2: 'Hard'
|
|
94252
|
+
},
|
|
94253
|
+
SubjectDistanceRange: {
|
|
94254
|
+
0: 'Unknown',
|
|
94255
|
+
1: 'Macro',
|
|
94256
|
+
2: 'Close view',
|
|
94257
|
+
3: 'Distant view'
|
|
94258
|
+
},
|
|
94259
|
+
FileSource: {
|
|
94260
|
+
3: 'DSC'
|
|
94261
|
+
},
|
|
94262
|
+
Components: {
|
|
94263
|
+
0: '',
|
|
94264
|
+
1: 'Y',
|
|
94265
|
+
2: 'Cb',
|
|
94266
|
+
3: 'Cr',
|
|
94267
|
+
4: 'R',
|
|
94268
|
+
5: 'G',
|
|
94269
|
+
6: 'B'
|
|
94270
|
+
}
|
|
94271
|
+
};
|
|
94272
|
+
function addEvent(element, event, handler) {
|
|
94273
|
+
if (element.addEventListener) {
|
|
94274
|
+
element.addEventListener(event, handler, false);
|
|
94275
|
+
} else if (element.attachEvent) {
|
|
94276
|
+
element.attachEvent('on' + event, handler);
|
|
94277
|
+
}
|
|
94278
|
+
}
|
|
94279
|
+
function imageHasData(img) {
|
|
94280
|
+
return !!img.exifdata;
|
|
94281
|
+
}
|
|
94282
|
+
function base64ToArrayBuffer(base64, contentType) {
|
|
94283
|
+
contentType = contentType || base64.match(/^data\:([^\;]+)\;base64,/im)[1] || ''; // e.g. 'data:image/jpeg;base64,...' => 'image/jpeg'
|
|
94284
|
+
base64 = base64.replace(/^data\:([^\;]+)\;base64,/gim, '');
|
|
94285
|
+
var binary = atob(base64);
|
|
94286
|
+
var len = binary.length;
|
|
94287
|
+
var buffer = new ArrayBuffer(len);
|
|
94288
|
+
var view = new Uint8Array(buffer);
|
|
94289
|
+
for (var i = 0; i < len; i++) {
|
|
94290
|
+
view[i] = binary.charCodeAt(i);
|
|
94291
|
+
}
|
|
94292
|
+
return buffer;
|
|
94293
|
+
}
|
|
94294
|
+
function objectURLToBlob(url, callback) {
|
|
94295
|
+
var http = new XMLHttpRequest();
|
|
94296
|
+
http.open('GET', url, true);
|
|
94297
|
+
http.responseType = 'blob';
|
|
94298
|
+
http.onload = function (e) {
|
|
94299
|
+
if (this.status == 200 || this.status === 0) {
|
|
94300
|
+
callback(this.response);
|
|
94301
|
+
}
|
|
94302
|
+
};
|
|
94303
|
+
http.send();
|
|
94304
|
+
}
|
|
94305
|
+
function getImageData(img, callback) {
|
|
94306
|
+
function handleBinaryFile(binFile) {
|
|
94307
|
+
var data = findEXIFinJPEG(binFile);
|
|
94308
|
+
// img.exifdata = data || {};
|
|
94309
|
+
// var iptcdata = findIPTCinJPEG(binFile);
|
|
94310
|
+
// img.iptcdata = iptcdata || {};
|
|
94311
|
+
// if (EXIF.isXmpEnabled) {
|
|
94312
|
+
// var xmpdata= findXMPinJPEG(binFile);
|
|
94313
|
+
// img.xmpdata = xmpdata || {};
|
|
94314
|
+
// }
|
|
94315
|
+
if (callback) {
|
|
94316
|
+
callback(data || {});
|
|
94317
|
+
}
|
|
94318
|
+
}
|
|
94319
|
+
if (img.src) {
|
|
94320
|
+
if (/^data\:/i.test(img.src)) {
|
|
94321
|
+
// Data URI
|
|
94322
|
+
var arrayBuffer = base64ToArrayBuffer(img.src);
|
|
94323
|
+
handleBinaryFile(arrayBuffer);
|
|
94324
|
+
} else if (/^blob\:/i.test(img.src)) {
|
|
94325
|
+
// Object URL
|
|
94326
|
+
var fileReader = new FileReader();
|
|
94327
|
+
fileReader.onload = function (e) {
|
|
94328
|
+
handleBinaryFile(e.target.result);
|
|
94329
|
+
};
|
|
94330
|
+
objectURLToBlob(img.src, function (blob) {
|
|
94331
|
+
fileReader.readAsArrayBuffer(blob);
|
|
94332
|
+
});
|
|
94333
|
+
} else {
|
|
94334
|
+
var http = new XMLHttpRequest();
|
|
94335
|
+
http.onload = function () {
|
|
94336
|
+
if (this.status == 200 || this.status === 0) {
|
|
94337
|
+
handleBinaryFile(http.response);
|
|
94338
|
+
} else {
|
|
94339
|
+
throw 'Could not load image';
|
|
94340
|
+
}
|
|
94341
|
+
http = null;
|
|
94342
|
+
};
|
|
94343
|
+
http.open('GET', img.src, true);
|
|
94344
|
+
http.responseType = 'arraybuffer';
|
|
94345
|
+
http.send(null);
|
|
94346
|
+
}
|
|
94347
|
+
} else if (self.FileReader && (img instanceof self.Blob || img instanceof self.File)) {
|
|
94348
|
+
var fileReader = new FileReader();
|
|
94349
|
+
fileReader.onload = function (e) {
|
|
94350
|
+
if (debug) {}
|
|
94351
|
+
handleBinaryFile(e.target.result);
|
|
94352
|
+
};
|
|
94353
|
+
fileReader.readAsArrayBuffer(img);
|
|
94354
|
+
}
|
|
94355
|
+
}
|
|
94356
|
+
function findEXIFinJPEG(file) {
|
|
94357
|
+
var dataView = new DataView(file);
|
|
94358
|
+
if (debug) {}
|
|
94359
|
+
if (dataView.getUint8(0) != 0xff || dataView.getUint8(1) != 0xd8) {
|
|
94360
|
+
if (debug) {}
|
|
94361
|
+
return false; // not a valid jpeg
|
|
94362
|
+
}
|
|
94363
|
+
|
|
94364
|
+
var offset = 2,
|
|
94365
|
+
length = file.byteLength,
|
|
94366
|
+
marker;
|
|
94367
|
+
while (offset < length) {
|
|
94368
|
+
if (dataView.getUint8(offset) != 0xff) {
|
|
94369
|
+
if (debug) {}
|
|
94370
|
+
return false; // not a valid marker, something is wrong
|
|
94371
|
+
}
|
|
94372
|
+
|
|
94373
|
+
marker = dataView.getUint8(offset + 1);
|
|
94374
|
+
if (debug) {}
|
|
94375
|
+
|
|
94376
|
+
// we could implement handling for other markers here,
|
|
94377
|
+
// but we're only looking for 0xFFE1 for EXIF data
|
|
94378
|
+
|
|
94379
|
+
if (marker == 225) {
|
|
94380
|
+
if (debug) {}
|
|
94381
|
+
return readEXIFData(dataView, offset + 4, dataView.getUint16(offset + 2) - 2);
|
|
94382
|
+
|
|
94383
|
+
// offset += 2 + file.getShortAt(offset+2, true);
|
|
94384
|
+
} else {
|
|
94385
|
+
offset += 2 + dataView.getUint16(offset + 2);
|
|
94386
|
+
}
|
|
94387
|
+
}
|
|
94388
|
+
}
|
|
94389
|
+
/**
|
|
94390
|
+
function findIPTCinJPEG(file) {
|
|
94391
|
+
var dataView = new DataView(file);
|
|
94392
|
+
if (debug) console.log("Got file of length " + file.byteLength);
|
|
94393
|
+
if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {
|
|
94394
|
+
if (debug) console.log("Not a valid JPEG");
|
|
94395
|
+
return false; // not a valid jpeg
|
|
94396
|
+
}
|
|
94397
|
+
var offset = 2,
|
|
94398
|
+
length = file.byteLength;
|
|
94399
|
+
var isFieldSegmentStart = function(dataView, offset){
|
|
94400
|
+
return (
|
|
94401
|
+
dataView.getUint8(offset) === 0x38 &&
|
|
94402
|
+
dataView.getUint8(offset+1) === 0x42 &&
|
|
94403
|
+
dataView.getUint8(offset+2) === 0x49 &&
|
|
94404
|
+
dataView.getUint8(offset+3) === 0x4D &&
|
|
94405
|
+
dataView.getUint8(offset+4) === 0x04 &&
|
|
94406
|
+
dataView.getUint8(offset+5) === 0x04
|
|
94407
|
+
);
|
|
94408
|
+
};
|
|
94409
|
+
while (offset < length) {
|
|
94410
|
+
if ( isFieldSegmentStart(dataView, offset )){
|
|
94411
|
+
// Get the length of the name header (which is padded to an even number of bytes)
|
|
94412
|
+
var nameHeaderLength = dataView.getUint8(offset+7);
|
|
94413
|
+
if(nameHeaderLength % 2 !== 0) nameHeaderLength += 1;
|
|
94414
|
+
// Check for pre photoshop 6 format
|
|
94415
|
+
if(nameHeaderLength === 0) {
|
|
94416
|
+
// Always 4
|
|
94417
|
+
nameHeaderLength = 4;
|
|
94418
|
+
}
|
|
94419
|
+
var startOffset = offset + 8 + nameHeaderLength;
|
|
94420
|
+
var sectionLength = dataView.getUint16(offset + 6 + nameHeaderLength);
|
|
94421
|
+
return readIPTCData(file, startOffset, sectionLength);
|
|
94422
|
+
break;
|
|
94423
|
+
}
|
|
94424
|
+
// Not the marker, continue searching
|
|
94425
|
+
offset++;
|
|
94426
|
+
}
|
|
94427
|
+
}
|
|
94428
|
+
var IptcFieldMap = {
|
|
94429
|
+
0x78 : 'caption',
|
|
94430
|
+
0x6E : 'credit',
|
|
94431
|
+
0x19 : 'keywords',
|
|
94432
|
+
0x37 : 'dateCreated',
|
|
94433
|
+
0x50 : 'byline',
|
|
94434
|
+
0x55 : 'bylineTitle',
|
|
94435
|
+
0x7A : 'captionWriter',
|
|
94436
|
+
0x69 : 'headline',
|
|
94437
|
+
0x74 : 'copyright',
|
|
94438
|
+
0x0F : 'category'
|
|
94439
|
+
};
|
|
94440
|
+
function readIPTCData(file, startOffset, sectionLength){
|
|
94441
|
+
var dataView = new DataView(file);
|
|
94442
|
+
var data = {};
|
|
94443
|
+
var fieldValue, fieldName, dataSize, segmentType, segmentSize;
|
|
94444
|
+
var segmentStartPos = startOffset;
|
|
94445
|
+
while(segmentStartPos < startOffset+sectionLength) {
|
|
94446
|
+
if(dataView.getUint8(segmentStartPos) === 0x1C && dataView.getUint8(segmentStartPos+1) === 0x02){
|
|
94447
|
+
segmentType = dataView.getUint8(segmentStartPos+2);
|
|
94448
|
+
if(segmentType in IptcFieldMap) {
|
|
94449
|
+
dataSize = dataView.getInt16(segmentStartPos+3);
|
|
94450
|
+
segmentSize = dataSize + 5;
|
|
94451
|
+
fieldName = IptcFieldMap[segmentType];
|
|
94452
|
+
fieldValue = getStringFromDB(dataView, segmentStartPos+5, dataSize);
|
|
94453
|
+
// Check if we already stored a value with this name
|
|
94454
|
+
if(data.hasOwnProperty(fieldName)) {
|
|
94455
|
+
// Value already stored with this name, create multivalue field
|
|
94456
|
+
if(data[fieldName] instanceof Array) {
|
|
94457
|
+
data[fieldName].push(fieldValue);
|
|
94458
|
+
}
|
|
94459
|
+
else {
|
|
94460
|
+
data[fieldName] = [data[fieldName], fieldValue];
|
|
94461
|
+
}
|
|
94462
|
+
}
|
|
94463
|
+
else {
|
|
94464
|
+
data[fieldName] = fieldValue;
|
|
94465
|
+
}
|
|
94466
|
+
}
|
|
94467
|
+
}
|
|
94468
|
+
segmentStartPos++;
|
|
94469
|
+
}
|
|
94470
|
+
return data;
|
|
94471
|
+
}
|
|
94472
|
+
*/
|
|
94473
|
+
|
|
94474
|
+
function readTags(file, tiffStart, dirStart, strings, bigEnd) {
|
|
94475
|
+
var entries = file.getUint16(dirStart, !bigEnd),
|
|
94476
|
+
tags = {},
|
|
94477
|
+
entryOffset,
|
|
94478
|
+
tag,
|
|
94479
|
+
i;
|
|
94480
|
+
for (i = 0; i < entries; i++) {
|
|
94481
|
+
entryOffset = dirStart + i * 12 + 2;
|
|
94482
|
+
tag = strings[file.getUint16(entryOffset, !bigEnd)];
|
|
94483
|
+
if (!tag && debug) {}
|
|
94484
|
+
if (tag) {
|
|
94485
|
+
tags[tag] = readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd);
|
|
94486
|
+
}
|
|
94487
|
+
}
|
|
94488
|
+
return tags;
|
|
94489
|
+
}
|
|
94490
|
+
function readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd) {
|
|
94491
|
+
var type = file.getUint16(entryOffset + 2, !bigEnd),
|
|
94492
|
+
numValues = file.getUint32(entryOffset + 4, !bigEnd),
|
|
94493
|
+
valueOffset = file.getUint32(entryOffset + 8, !bigEnd) + tiffStart,
|
|
94494
|
+
offset,
|
|
94495
|
+
vals,
|
|
94496
|
+
val,
|
|
94497
|
+
n,
|
|
94498
|
+
numerator,
|
|
94499
|
+
denominator;
|
|
94500
|
+
switch (type) {
|
|
94501
|
+
case 1: // byte, 8-bit unsigned int
|
|
94502
|
+
case 7:
|
|
94503
|
+
// undefined, 8-bit byte, value depending on field
|
|
94504
|
+
if (numValues == 1) {
|
|
94505
|
+
return file.getUint8(entryOffset + 8, !bigEnd);
|
|
94506
|
+
} else {
|
|
94507
|
+
offset = numValues > 4 ? valueOffset : entryOffset + 8;
|
|
94508
|
+
vals = [];
|
|
94509
|
+
for (n = 0; n < numValues; n++) {
|
|
94510
|
+
vals[n] = file.getUint8(offset + n);
|
|
94511
|
+
}
|
|
94512
|
+
return vals;
|
|
94513
|
+
}
|
|
94514
|
+
case 2:
|
|
94515
|
+
// ascii, 8-bit byte
|
|
94516
|
+
offset = numValues > 4 ? valueOffset : entryOffset + 8;
|
|
94517
|
+
return getStringFromDB(file, offset, numValues - 1);
|
|
94518
|
+
case 3:
|
|
94519
|
+
// short, 16 bit int
|
|
94520
|
+
if (numValues == 1) {
|
|
94521
|
+
return file.getUint16(entryOffset + 8, !bigEnd);
|
|
94522
|
+
} else {
|
|
94523
|
+
offset = numValues > 2 ? valueOffset : entryOffset + 8;
|
|
94524
|
+
vals = [];
|
|
94525
|
+
for (n = 0; n < numValues; n++) {
|
|
94526
|
+
vals[n] = file.getUint16(offset + 2 * n, !bigEnd);
|
|
94527
|
+
}
|
|
94528
|
+
return vals;
|
|
94529
|
+
}
|
|
94530
|
+
case 4:
|
|
94531
|
+
// long, 32 bit int
|
|
94532
|
+
if (numValues == 1) {
|
|
94533
|
+
return file.getUint32(entryOffset + 8, !bigEnd);
|
|
94534
|
+
} else {
|
|
94535
|
+
vals = [];
|
|
94536
|
+
for (n = 0; n < numValues; n++) {
|
|
94537
|
+
vals[n] = file.getUint32(valueOffset + 4 * n, !bigEnd);
|
|
94538
|
+
}
|
|
94539
|
+
return vals;
|
|
94540
|
+
}
|
|
94541
|
+
case 5:
|
|
94542
|
+
// rational = two long values, first is numerator, second is denominator
|
|
94543
|
+
if (numValues == 1) {
|
|
94544
|
+
numerator = file.getUint32(valueOffset, !bigEnd);
|
|
94545
|
+
denominator = file.getUint32(valueOffset + 4, !bigEnd);
|
|
94546
|
+
val = new Number(numerator / denominator);
|
|
94547
|
+
val.numerator = numerator;
|
|
94548
|
+
val.denominator = denominator;
|
|
94549
|
+
return val;
|
|
94550
|
+
} else {
|
|
94551
|
+
vals = [];
|
|
94552
|
+
for (n = 0; n < numValues; n++) {
|
|
94553
|
+
numerator = file.getUint32(valueOffset + 8 * n, !bigEnd);
|
|
94554
|
+
denominator = file.getUint32(valueOffset + 4 + 8 * n, !bigEnd);
|
|
94555
|
+
vals[n] = new Number(numerator / denominator);
|
|
94556
|
+
vals[n].numerator = numerator;
|
|
94557
|
+
vals[n].denominator = denominator;
|
|
94558
|
+
}
|
|
94559
|
+
return vals;
|
|
94560
|
+
}
|
|
94561
|
+
case 9:
|
|
94562
|
+
// slong, 32 bit signed int
|
|
94563
|
+
if (numValues == 1) {
|
|
94564
|
+
return file.getInt32(entryOffset + 8, !bigEnd);
|
|
94565
|
+
} else {
|
|
94566
|
+
vals = [];
|
|
94567
|
+
for (n = 0; n < numValues; n++) {
|
|
94568
|
+
vals[n] = file.getInt32(valueOffset + 4 * n, !bigEnd);
|
|
94569
|
+
}
|
|
94570
|
+
return vals;
|
|
94571
|
+
}
|
|
94572
|
+
case 10:
|
|
94573
|
+
// signed rational, two slongs, first is numerator, second is denominator
|
|
94574
|
+
if (numValues == 1) {
|
|
94575
|
+
return file.getInt32(valueOffset, !bigEnd) / file.getInt32(valueOffset + 4, !bigEnd);
|
|
94576
|
+
} else {
|
|
94577
|
+
vals = [];
|
|
94578
|
+
for (n = 0; n < numValues; n++) {
|
|
94579
|
+
vals[n] = file.getInt32(valueOffset + 8 * n, !bigEnd) / file.getInt32(valueOffset + 4 + 8 * n, !bigEnd);
|
|
94580
|
+
}
|
|
94581
|
+
return vals;
|
|
94582
|
+
}
|
|
94583
|
+
}
|
|
94584
|
+
}
|
|
94585
|
+
|
|
94586
|
+
/**
|
|
94587
|
+
* Given an IFD (Image File Directory) start offset
|
|
94588
|
+
* returns an offset to next IFD or 0 if it's the last IFD.
|
|
94589
|
+
*/
|
|
94590
|
+
function getNextIFDOffset(dataView, dirStart, bigEnd) {
|
|
94591
|
+
//the first 2bytes means the number of directory entries contains in this IFD
|
|
94592
|
+
var entries = dataView.getUint16(dirStart, !bigEnd);
|
|
94593
|
+
|
|
94594
|
+
// After last directory entry, there is a 4bytes of data,
|
|
94595
|
+
// it means an offset to next IFD.
|
|
94596
|
+
// If its value is '0x00000000', it means this is the last IFD and there is no linked IFD.
|
|
94597
|
+
|
|
94598
|
+
return dataView.getUint32(dirStart + 2 + entries * 12, !bigEnd); // each entry is 12 bytes long
|
|
94599
|
+
}
|
|
94600
|
+
|
|
94601
|
+
function readThumbnailImage(dataView, tiffStart, firstIFDOffset, bigEnd) {
|
|
94602
|
+
// get the IFD1 offset
|
|
94603
|
+
var IFD1OffsetPointer = getNextIFDOffset(dataView, tiffStart + firstIFDOffset, bigEnd);
|
|
94604
|
+
if (!IFD1OffsetPointer) {
|
|
94605
|
+
// console.log('******** IFD1Offset is empty, image thumb not found ********');
|
|
94606
|
+
return {};
|
|
94607
|
+
} else if (IFD1OffsetPointer > dataView.byteLength) {
|
|
94608
|
+
// this should not happen
|
|
94609
|
+
// console.log('******** IFD1Offset is outside the bounds of the DataView ********');
|
|
94610
|
+
return {};
|
|
94611
|
+
}
|
|
94612
|
+
// console.log('******* thumbnail IFD offset (IFD1) is: %s', IFD1OffsetPointer);
|
|
94613
|
+
|
|
94614
|
+
var thumbTags = readTags(dataView, tiffStart, tiffStart + IFD1OffsetPointer, IFD1Tags, bigEnd);
|
|
94615
|
+
|
|
94616
|
+
// EXIF 2.3 specification for JPEG format thumbnail
|
|
94617
|
+
|
|
94618
|
+
// If the value of Compression(0x0103) Tag in IFD1 is '6', thumbnail image format is JPEG.
|
|
94619
|
+
// Most of Exif image uses JPEG format for thumbnail. In that case, you can get offset of thumbnail
|
|
94620
|
+
// by JpegIFOffset(0x0201) Tag in IFD1, size of thumbnail by JpegIFByteCount(0x0202) Tag.
|
|
94621
|
+
// Data format is ordinary JPEG format, starts from 0xFFD8 and ends by 0xFFD9. It seems that
|
|
94622
|
+
// JPEG format and 160x120pixels of size are recommended thumbnail format for Exif2.1 or later.
|
|
94623
|
+
|
|
94624
|
+
if (thumbTags['Compression']) {
|
|
94625
|
+
// console.log('Thumbnail image found!');
|
|
94626
|
+
|
|
94627
|
+
switch (thumbTags['Compression']) {
|
|
94628
|
+
case 6:
|
|
94629
|
+
// console.log('Thumbnail image format is JPEG');
|
|
94630
|
+
if (thumbTags.JpegIFOffset && thumbTags.JpegIFByteCount) {
|
|
94631
|
+
// extract the thumbnail
|
|
94632
|
+
var tOffset = tiffStart + thumbTags.JpegIFOffset;
|
|
94633
|
+
var tLength = thumbTags.JpegIFByteCount;
|
|
94634
|
+
thumbTags['blob'] = new Blob([new Uint8Array(dataView.buffer, tOffset, tLength)], {
|
|
94635
|
+
type: 'image/jpeg'
|
|
94636
|
+
});
|
|
94637
|
+
}
|
|
94638
|
+
break;
|
|
94639
|
+
case 1:
|
|
94640
|
+
break;
|
|
94641
|
+
default:
|
|
94642
|
+
}
|
|
94643
|
+
} else if (thumbTags['PhotometricInterpretation'] == 2) {}
|
|
94644
|
+
return thumbTags;
|
|
94645
|
+
}
|
|
94646
|
+
function getStringFromDB(buffer, start, length) {
|
|
94647
|
+
var outstr = '';
|
|
94648
|
+
for (var n = start; n < start + length; n++) {
|
|
94649
|
+
outstr += String.fromCharCode(buffer.getUint8(n));
|
|
94650
|
+
}
|
|
94651
|
+
return outstr;
|
|
94652
|
+
}
|
|
94653
|
+
function readEXIFData(file, start) {
|
|
94654
|
+
if (getStringFromDB(file, start, 4) != 'Exif') {
|
|
94655
|
+
if (debug) {}
|
|
94656
|
+
return false;
|
|
94657
|
+
}
|
|
94658
|
+
var bigEnd,
|
|
94659
|
+
tags,
|
|
94660
|
+
tag,
|
|
94661
|
+
exifData,
|
|
94662
|
+
gpsData,
|
|
94663
|
+
tiffOffset = start + 6;
|
|
94664
|
+
|
|
94665
|
+
// test for TIFF validity and endianness
|
|
94666
|
+
if (file.getUint16(tiffOffset) == 0x4949) {
|
|
94667
|
+
bigEnd = false;
|
|
94668
|
+
} else if (file.getUint16(tiffOffset) == 0x4d4d) {
|
|
94669
|
+
bigEnd = true;
|
|
94670
|
+
} else {
|
|
94671
|
+
if (debug) {}
|
|
94672
|
+
return false;
|
|
94673
|
+
}
|
|
94674
|
+
if (file.getUint16(tiffOffset + 2, !bigEnd) != 0x002a) {
|
|
94675
|
+
if (debug) {}
|
|
94676
|
+
return false;
|
|
94677
|
+
}
|
|
94678
|
+
var firstIFDOffset = file.getUint32(tiffOffset + 4, !bigEnd);
|
|
94679
|
+
if (firstIFDOffset < 0x00000008) {
|
|
94680
|
+
if (debug) {}
|
|
94681
|
+
return false;
|
|
94682
|
+
}
|
|
94683
|
+
tags = readTags(file, tiffOffset, tiffOffset + firstIFDOffset, TiffTags, bigEnd);
|
|
94684
|
+
|
|
94685
|
+
/**
|
|
94686
|
+
if (tags.ExifIFDPointer) {
|
|
94687
|
+
exifData = readTags(file, tiffOffset, tiffOffset + tags.ExifIFDPointer, ExifTags, bigEnd);
|
|
94688
|
+
console.log(exifData, "22222222222222");
|
|
94689
|
+
for (tag in exifData) {
|
|
94690
|
+
switch (tag) {
|
|
94691
|
+
case 'LightSource':
|
|
94692
|
+
case 'Flash':
|
|
94693
|
+
case 'MeteringMode':
|
|
94694
|
+
case 'ExposureProgram':
|
|
94695
|
+
case 'SensingMethod':
|
|
94696
|
+
case 'SceneCaptureType':
|
|
94697
|
+
case 'SceneType':
|
|
94698
|
+
case 'CustomRendered':
|
|
94699
|
+
case 'WhiteBalance':
|
|
94700
|
+
case 'GainControl':
|
|
94701
|
+
case 'Contrast':
|
|
94702
|
+
case 'Saturation':
|
|
94703
|
+
case 'Sharpness':
|
|
94704
|
+
case 'SubjectDistanceRange':
|
|
94705
|
+
case 'FileSource':
|
|
94706
|
+
exifData[tag] = StringValues[tag][exifData[tag]];
|
|
94707
|
+
break;
|
|
94708
|
+
case 'ExifVersion':
|
|
94709
|
+
case 'FlashpixVersion':
|
|
94710
|
+
exifData[tag] = String.fromCharCode(exifData[tag][0], exifData[tag][1], exifData[tag][2], exifData[tag][3]);
|
|
94711
|
+
break;
|
|
94712
|
+
case 'ComponentsConfiguration':
|
|
94713
|
+
exifData[tag] =
|
|
94714
|
+
StringValues.Components[exifData[tag][0]] +
|
|
94715
|
+
StringValues.Components[exifData[tag][1]] +
|
|
94716
|
+
StringValues.Components[exifData[tag][2]] +
|
|
94717
|
+
StringValues.Components[exifData[tag][3]];
|
|
94718
|
+
break;
|
|
94719
|
+
}
|
|
94720
|
+
tags[tag] = exifData[tag];
|
|
94721
|
+
}
|
|
94722
|
+
}
|
|
94723
|
+
*/
|
|
94724
|
+
if (tags.GPSInfoIFDPointer) {
|
|
94725
|
+
gpsData = readTags(file, tiffOffset, tiffOffset + tags.GPSInfoIFDPointer, GPSTags, bigEnd);
|
|
94726
|
+
for (tag in gpsData) {
|
|
94727
|
+
switch (tag) {
|
|
94728
|
+
case 'GPSVersionID':
|
|
94729
|
+
gpsData[tag] = gpsData[tag][0] + '.' + gpsData[tag][1] + '.' + gpsData[tag][2] + '.' + gpsData[tag][3];
|
|
94730
|
+
break;
|
|
94731
|
+
}
|
|
94732
|
+
tags[tag] = gpsData[tag];
|
|
94733
|
+
}
|
|
94734
|
+
}
|
|
94735
|
+
|
|
94736
|
+
// extract thumbnail
|
|
94737
|
+
tags['thumbnail'] = readThumbnailImage(file, tiffOffset, firstIFDOffset, bigEnd);
|
|
94738
|
+
return tags;
|
|
94739
|
+
}
|
|
94740
|
+
/**
|
|
94741
|
+
function findXMPinJPEG(file) {
|
|
94742
|
+
if (!('DOMParser' in self)) {
|
|
94743
|
+
// console.warn('XML parsing not supported without DOMParser');
|
|
94744
|
+
return;
|
|
94745
|
+
}
|
|
94746
|
+
var dataView = new DataView(file);
|
|
94747
|
+
if (debug) console.log('Got file of length ' + file.byteLength);
|
|
94748
|
+
if (dataView.getUint8(0) != 0xff || dataView.getUint8(1) != 0xd8) {
|
|
94749
|
+
if (debug) console.log('Not a valid JPEG');
|
|
94750
|
+
return false; // not a valid jpeg
|
|
94751
|
+
}
|
|
94752
|
+
var offset = 2,
|
|
94753
|
+
length = file.byteLength,
|
|
94754
|
+
dom = new DOMParser();
|
|
94755
|
+
while (offset < length - 4) {
|
|
94756
|
+
if (getStringFromDB(dataView, offset, 4) == 'http') {
|
|
94757
|
+
var startOffset = offset - 1;
|
|
94758
|
+
var sectionLength = dataView.getUint16(offset - 2) - 1;
|
|
94759
|
+
var xmpString = getStringFromDB(dataView, startOffset, sectionLength);
|
|
94760
|
+
var xmpEndIndex = xmpString.indexOf('xmpmeta>') + 8;
|
|
94761
|
+
xmpString = xmpString.substring(xmpString.indexOf('<x:xmpmeta'), xmpEndIndex);
|
|
94762
|
+
var indexOfXmp = xmpString.indexOf('x:xmpmeta') + 10;
|
|
94763
|
+
//Many custom written programs embed xmp/xml without any namespace. Following are some of them.
|
|
94764
|
+
//Without these namespaces, XML is thought to be invalid by parsers
|
|
94765
|
+
xmpString =
|
|
94766
|
+
xmpString.slice(0, indexOfXmp) +
|
|
94767
|
+
'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" ' +
|
|
94768
|
+
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
|
|
94769
|
+
'xmlns:tiff="http://ns.adobe.com/tiff/1.0/" ' +
|
|
94770
|
+
'xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" ' +
|
|
94771
|
+
'xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" ' +
|
|
94772
|
+
'xmlns:exif="http://ns.adobe.com/exif/1.0/" ' +
|
|
94773
|
+
'xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" ' +
|
|
94774
|
+
'xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" ' +
|
|
94775
|
+
'xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" ' +
|
|
94776
|
+
'xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" ' +
|
|
94777
|
+
'xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" ' +
|
|
94778
|
+
xmpString.slice(indexOfXmp);
|
|
94779
|
+
var domDocument = dom.parseFromString(xmpString, 'text/xml');
|
|
94780
|
+
return xml2Object(domDocument);
|
|
94781
|
+
} else {
|
|
94782
|
+
offset++;
|
|
94783
|
+
}
|
|
94784
|
+
}
|
|
94785
|
+
}
|
|
94786
|
+
function xml2json(xml) {
|
|
94787
|
+
var json = {};
|
|
94788
|
+
if (xml.nodeType == 1) {
|
|
94789
|
+
// element node
|
|
94790
|
+
if (xml.attributes.length > 0) {
|
|
94791
|
+
json['@attributes'] = {};
|
|
94792
|
+
for (var j = 0; j < xml.attributes.length; j++) {
|
|
94793
|
+
var attribute = xml.attributes.item(j);
|
|
94794
|
+
json['@attributes'][attribute.nodeName] = attribute.nodeValue;
|
|
94795
|
+
}
|
|
94796
|
+
}
|
|
94797
|
+
} else if (xml.nodeType == 3) {
|
|
94798
|
+
// text node
|
|
94799
|
+
return xml.nodeValue;
|
|
94800
|
+
}
|
|
94801
|
+
// deal with children
|
|
94802
|
+
if (xml.hasChildNodes()) {
|
|
94803
|
+
for (var i = 0; i < xml.childNodes.length; i++) {
|
|
94804
|
+
var child = xml.childNodes.item(i);
|
|
94805
|
+
var nodeName = child.nodeName;
|
|
94806
|
+
if (json[nodeName] == null) {
|
|
94807
|
+
json[nodeName] = xml2json(child);
|
|
94808
|
+
} else {
|
|
94809
|
+
if (json[nodeName].push == null) {
|
|
94810
|
+
var old = json[nodeName];
|
|
94811
|
+
json[nodeName] = [];
|
|
94812
|
+
json[nodeName].push(old);
|
|
94813
|
+
}
|
|
94814
|
+
json[nodeName].push(xml2json(child));
|
|
94815
|
+
}
|
|
94816
|
+
}
|
|
94817
|
+
}
|
|
94818
|
+
return json;
|
|
94819
|
+
}
|
|
94820
|
+
function xml2Object(xml) {
|
|
94821
|
+
try {
|
|
94822
|
+
var obj = {};
|
|
94823
|
+
if (xml.children.length > 0) {
|
|
94824
|
+
for (var i = 0; i < xml.children.length; i++) {
|
|
94825
|
+
var item = xml.children.item(i);
|
|
94826
|
+
var attributes = item.attributes;
|
|
94827
|
+
for (var idx in attributes) {
|
|
94828
|
+
var itemAtt = attributes[idx];
|
|
94829
|
+
var dataKey = itemAtt.nodeName;
|
|
94830
|
+
var dataValue = itemAtt.nodeValue;
|
|
94831
|
+
if (dataKey !== undefined) {
|
|
94832
|
+
obj[dataKey] = dataValue;
|
|
94833
|
+
}
|
|
94834
|
+
}
|
|
94835
|
+
var nodeName = item.nodeName;
|
|
94836
|
+
if (typeof obj[nodeName] == 'undefined') {
|
|
94837
|
+
obj[nodeName] = xml2json(item);
|
|
94838
|
+
} else {
|
|
94839
|
+
if (typeof obj[nodeName].push == 'undefined') {
|
|
94840
|
+
var old = obj[nodeName];
|
|
94841
|
+
obj[nodeName] = [];
|
|
94842
|
+
obj[nodeName].push(old);
|
|
94843
|
+
}
|
|
94844
|
+
obj[nodeName].push(xml2json(item));
|
|
94845
|
+
}
|
|
94846
|
+
}
|
|
94847
|
+
} else {
|
|
94848
|
+
obj = xml.textContent;
|
|
94849
|
+
}
|
|
94850
|
+
return obj;
|
|
94851
|
+
} catch (e) {
|
|
94852
|
+
console.log(e.message);
|
|
94853
|
+
}
|
|
94854
|
+
}
|
|
94855
|
+
*/
|
|
94856
|
+
|
|
94857
|
+
EXIF.getData = function (img, callback) {
|
|
94858
|
+
if ((self.Image && img instanceof self.Image || self.HTMLImageElement && img instanceof self.HTMLImageElement) && !img.complete) return false;
|
|
94859
|
+
if (!imageHasData(img)) {
|
|
94860
|
+
getImageData(img, callback);
|
|
94861
|
+
} else {
|
|
94862
|
+
if (callback) {
|
|
94863
|
+
callback.call(img);
|
|
94864
|
+
}
|
|
94865
|
+
}
|
|
94866
|
+
return true;
|
|
94867
|
+
};
|
|
94868
|
+
/**
|
|
94869
|
+
EXIF.enableXmp = function () {
|
|
94870
|
+
EXIF.isXmpEnabled = true;
|
|
94871
|
+
};
|
|
94872
|
+
EXIF.disableXmp = function () {
|
|
94873
|
+
EXIF.isXmpEnabled = false;
|
|
94874
|
+
};
|
|
94875
|
+
|
|
94876
|
+
EXIF.getTag = function (img, tag) {
|
|
94877
|
+
if (!imageHasData(img)) return;
|
|
94878
|
+
return img.exifdata[tag];
|
|
94879
|
+
};
|
|
94880
|
+
EXIF.getIptcTag = function (img, tag) {
|
|
94881
|
+
if (!imageHasData(img)) return;
|
|
94882
|
+
return img.iptcdata[tag];
|
|
94883
|
+
};
|
|
94884
|
+
EXIF.getAllTags = function (img) {
|
|
94885
|
+
if (!imageHasData(img)) return {};
|
|
94886
|
+
var a,
|
|
94887
|
+
data = img.exifdata,
|
|
94888
|
+
tags = {};
|
|
94889
|
+
for (a in data) {
|
|
94890
|
+
if (data.hasOwnProperty(a)) {
|
|
94891
|
+
tags[a] = data[a];
|
|
94892
|
+
}
|
|
94893
|
+
}
|
|
94894
|
+
return tags;
|
|
94895
|
+
};
|
|
94896
|
+
EXIF.getAllIptcTags = function (img) {
|
|
94897
|
+
if (!imageHasData(img)) return {};
|
|
94898
|
+
var a,
|
|
94899
|
+
data = img.iptcdata,
|
|
94900
|
+
tags = {};
|
|
94901
|
+
for (a in data) {
|
|
94902
|
+
if (data.hasOwnProperty(a)) {
|
|
94903
|
+
tags[a] = data[a];
|
|
94904
|
+
}
|
|
94905
|
+
}
|
|
94906
|
+
return tags;
|
|
94907
|
+
};
|
|
94908
|
+
EXIF.pretty = function (img) {
|
|
94909
|
+
if (!imageHasData(img)) return '';
|
|
94910
|
+
var a,
|
|
94911
|
+
data = img.exifdata,
|
|
94912
|
+
strPretty = '';
|
|
94913
|
+
for (a in data) {
|
|
94914
|
+
if (data.hasOwnProperty(a)) {
|
|
94915
|
+
if (typeof data[a] == 'object') {
|
|
94916
|
+
if (data[a] instanceof Number) {
|
|
94917
|
+
strPretty += a + ' : ' + data[a] + ' [' + data[a].numerator + '/' + data[a].denominator + ']\r\n';
|
|
94918
|
+
} else {
|
|
94919
|
+
strPretty += a + ' : [' + data[a].length + ' values]\r\n';
|
|
94920
|
+
}
|
|
94921
|
+
} else {
|
|
94922
|
+
strPretty += a + ' : ' + data[a] + '\r\n';
|
|
94923
|
+
}
|
|
94924
|
+
}
|
|
94925
|
+
}
|
|
94926
|
+
return strPretty;
|
|
94927
|
+
};
|
|
94928
|
+
EXIF.readFromBinaryFile = function (file) {
|
|
94929
|
+
return findEXIFinJPEG(file);
|
|
94930
|
+
};
|
|
94931
|
+
*/
|
|
94932
|
+
|
|
94933
|
+
if (true) {
|
|
94934
|
+
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
|
94935
|
+
return EXIF;
|
|
94936
|
+
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
94937
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
94938
|
+
}
|
|
94939
|
+
}).call(this);
|
|
94940
|
+
|
|
94941
|
+
/***/ }),
|
|
94942
|
+
|
|
93837
94943
|
/***/ 77937:
|
|
93838
94944
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
93839
94945
|
|
|
@@ -98068,10 +99174,10 @@ if(image.colorSpace===color_spaces.INDEXED){var objId=this.internal.newObject();
|
|
|
98068
99174
|
putStream({data:arrayBufferToBinaryString(new Uint8Array(image.palette)),objectId:objId});out("endobj");}};var putResourcesCallback=function putResourcesCallback(){var images=this.internal.collections[namespace+"images"];for(var i in images){putImage.call(this,images[i]);}};var putXObjectsDictCallback=function putXObjectsDictCallback(){var images=this.internal.collections[namespace+"images"],out=this.internal.write,image;for(var i in images){image=images[i];out("/I"+image.index,image.objectId,"0","R");}};var checkCompressValue=function checkCompressValue(value){if(value&&typeof value==="string")value=value.toUpperCase();return value in jsPDFAPI.image_compression?value:image_compression.NONE;};var initialize=function initialize(){if(!this.internal.collections[namespace+"images"]){this.internal.collections[namespace+"images"]={};this.internal.events.subscribe("putResources",putResourcesCallback);this.internal.events.subscribe("putXobjectDict",putXObjectsDictCallback);}};var getImages=function getImages(){var images=this.internal.collections[namespace+"images"];initialize.call(this);return images;};var getImageIndex=function getImageIndex(){return Object.keys(this.internal.collections[namespace+"images"]).length;};var notDefined=function notDefined(value){return typeof value==="undefined"||value===null||value.length===0;};var generateAliasFromImageData=function generateAliasFromImageData(imageData){if(typeof imageData==="string"||isArrayBufferView(imageData)){return sHashCode(imageData);}else if(isArrayBufferView(imageData.data)){return sHashCode(imageData.data);}return null;};var isImageTypeSupported=function isImageTypeSupported(type){return typeof jsPDFAPI["process"+type.toUpperCase()]==="function";};var isDOMElement=function isDOMElement(object){return (0,esm_typeof/* default */.Z)(object)==="object"&&object.nodeType===1;};var getImageDataFromElement=function getImageDataFromElement(element,format){//if element is an image which uses data url definition, just return the dataurl
|
|
98069
99175
|
if(element.nodeName==="IMG"&&element.hasAttribute("src")){var src=""+element.getAttribute("src");//is base64 encoded dataUrl, directly process it
|
|
98070
99176
|
if(src.indexOf("data:image/")===0){return atob(unescape(src).split("base64,").pop());}//it is probably an url, try to load it
|
|
98071
|
-
var tmpImageData=jsPDFAPI.loadFile(src,true);if(tmpImageData!==undefined){return tmpImageData;}}if(element.nodeName==="CANVAS"){if(element.width===0||element.height===0){throw new Error("Given canvas must have data. Canvas width: "+element.width+", height: "+element.height);}var mimeType;switch(format){case"PNG":mimeType="image/png";break;case"WEBP":mimeType="image/webp";break;case"JPEG":case"JPG":default:mimeType="image/jpeg";break;}return atob(element.toDataURL(mimeType,1.0).split("base64,").pop());}};var checkImagesForAlias=function checkImagesForAlias(alias){var images=this.internal.collections[namespace+"images"];if(images){for(var e in images){if(alias===images[e].alias){return images[e];}}}};var determineWidthAndHeight=function determineWidthAndHeight(width,height,image){if(!width&&!height){width=-96;height=-96;}if(width<0){width=-1*image.width*72/width/this.internal.scaleFactor;}if(height<0){height=-1*image.height*72/height/this.internal.scaleFactor;}if(width===0){width=height*image.width/image.height;}if(height===0){height=width*image.height/image.width;}return[width,height];};var writeImageToPDF=function writeImageToPDF(x,y,width,height,image,rotation){var dims=determineWidthAndHeight.call(this,width,height,image),coord=this.internal.getCoordinateString,vcoord=this.internal.getVerticalCoordinateString;var images=getImages.call(this);width=dims[0];height=dims[1];images[image.index]=image;if(rotation){rotation*=Math.PI/180;var c=Math.cos(rotation);var s=Math.sin(rotation);//like in pdf Reference do it 4 digits instead of 2
|
|
99177
|
+
var tmpImageData=jsPDFAPI.loadFile(src,true);if(tmpImageData!==undefined){return tmpImageData;}}if(element.nodeName==="CANVAS"){if(element.width===0||element.height===0){throw new Error("Given canvas must have data. Canvas width: "+element.width+", height: "+element.height);}var mimeType;switch(format){case"PNG":mimeType="image/png";break;case"WEBP":mimeType="image/webp";break;case"JPEG":case"JPG":default:mimeType="image/jpeg";break;}return atob(element.toDataURL(mimeType,1.0).split("base64,").pop());}};var checkImagesForAlias=function checkImagesForAlias(alias){var images=this.internal.collections[namespace+"images"];if(images){for(var e in images){if(alias===images[e].alias){return images[e];}}}};var determineWidthAndHeight=function determineWidthAndHeight(width,height,image){if(!width&&!height){width=-96;height=-96;}if(width<0){width=-1*image.width*72/width/this.internal.scaleFactor;}if(height<0){height=-1*image.height*72/height/this.internal.scaleFactor;}if(width===0){width=height*image.width/image.height;}if(height===0){height=width*image.height/image.width;}return[width,height];};var writeImageToPDF=function writeImageToPDF(x,y,width,height,image,rotation){var dims=determineWidthAndHeight.call(this,width,height,image),coord=this.internal.getCoordinateString,vcoord=this.internal.getVerticalCoordinateString;var images=getImages.call(this);width=dims[0];height=dims[1];images[image.index]=image;console.log(image.exifdata,'----------------------');if(image.exifdata&&image.exifdata.Orientation){rotation={6:270,8:90,5:180,7:180,2:270,4:90,1:180,3:180}[image.exifdata.Orientation];}if(rotation){rotation*=Math.PI/180;var c=Math.cos(rotation);var s=Math.sin(rotation);//like in pdf Reference do it 4 digits instead of 2
|
|
98072
99178
|
var f4=function f4(number){return number.toFixed(4);};var rotationTransformationMatrix=[f4(c),f4(s),f4(s*-1),f4(c),0,0,"cm"];}this.internal.write("q");//Save graphics state
|
|
98073
|
-
if(rotation){// 自定义修改 修复图片旋转后位置错误问题 水平方向增加自身宽度 减去的 18px 来源未知 垂直方向减去自身高度
|
|
98074
|
-
x+=Number(coord(width))+
|
|
99179
|
+
if(rotation){if(image.exifdata&&image.exifdata.Orientation){if(image.exifdata.Orientation==8||image.exifdata.Orientation==4){x+=height;y-=width-10;}else if(image.exifdata.Orientation==6||image.exifdata.Orientation==2){y-=width-10;}}else{// 自定义修改 修复图片旋转后位置错误问题 水平方向增加自身宽度 减去的 18px 来源未知 垂直方向减去自身高度
|
|
99180
|
+
x+=Number(coord(width))+20;y-=height;}console.log(width,height,x,y,'---------------------');this.internal.write([1,"0","0",1,coord(x),vcoord(y+height),"cm"].join(" "));//Translate
|
|
98075
99181
|
this.internal.write(rotationTransformationMatrix.join(" "));//Rotate
|
|
98076
99182
|
this.internal.write([coord(width),"0","0",coord(height),"0","0","cm"].join(" "));//Scale
|
|
98077
99183
|
}else{this.internal.write([coord(width),"0","0",coord(height),coord(x),vcoord(y+height),"cm"].join(" "));//Translate and Scale
|
|
@@ -98185,9 +99291,9 @@ var imageData,format,x,y,w,h,alias,compression,rotation,posX,posY;imageData=argu
|
|
|
98185
99291
|
var filter=this.internal.getFilters();if(compression===undefined&&filter.indexOf("FlateEncode")!==-1){compression="SLOW";}// 自定义修改 调整 addImage 方法的 compression值压缩图片
|
|
98186
99292
|
compression='SLOW';if(isNaN(x)||isNaN(y)){throw new Error("Invalid coordinates passed to jsPDF.addImage");}// if(posX) x += posX;
|
|
98187
99293
|
// if(posY) y += posY;
|
|
98188
|
-
initialize.call(this);var image=processImageData.call(this,imageData,format,alias,compression);writeImageToPDF.call(this,x,y,w,h,image,rotation);return this;};var processImageData=function processImageData(imageData,format,alias,compression){var result,dataAsBinaryString;if(typeof imageData==="string"&&getImageFileTypeByImageData(imageData)===UNKNOWN){imageData=unescape(imageData);var tmpImageData=convertBase64ToBinaryString(imageData,false);if(tmpImageData!==""){imageData=tmpImageData;}else{tmpImageData=jsPDFAPI.loadFile(imageData,true);if(tmpImageData!==undefined){imageData=tmpImageData;}}}if(isDOMElement(imageData)){imageData=getImageDataFromElement(imageData,format);}format=getImageFileTypeByImageData(imageData,format);if(!isImageTypeSupported(format)){throw new Error("addImage does not support files of type '"+format+"', please ensure that a plugin for '"+format+"' support is added.");}// now do the heavy lifting
|
|
99294
|
+
initialize.call(this);var image=processImageData.call(this,imageData,format,alias,compression);writeImageToPDF.call(this,x,y,w,h,image,rotation);return this;};var processImageData=function processImageData(imageData,format,alias,compression){var result,dataAsBinaryString;var exifdata=imageData.exifdata;if(typeof imageData==="string"&&getImageFileTypeByImageData(imageData)===UNKNOWN){imageData=unescape(imageData);var tmpImageData=convertBase64ToBinaryString(imageData,false);if(tmpImageData!==""){imageData=tmpImageData;}else{tmpImageData=jsPDFAPI.loadFile(imageData,true);if(tmpImageData!==undefined){imageData=tmpImageData;}}}if(isDOMElement(imageData)){imageData=getImageDataFromElement(imageData,format);}format=getImageFileTypeByImageData(imageData,format);if(!isImageTypeSupported(format)){throw new Error("addImage does not support files of type '"+format+"', please ensure that a plugin for '"+format+"' support is added.");}// now do the heavy lifting
|
|
98189
99295
|
if(notDefined(alias)){alias=generateAliasFromImageData(imageData);}result=checkImagesForAlias.call(this,alias);if(!result){if(supportsArrayBuffer()){// no need to convert if imageData is already uint8array
|
|
98190
|
-
if(!(imageData instanceof Uint8Array)&&format!=="RGBA"){dataAsBinaryString=imageData;imageData=binaryStringToUint8Array(imageData);}}result=this["process"+format.toUpperCase()](imageData,getImageIndex.call(this),alias,checkCompressValue(compression),dataAsBinaryString);}if(!result){throw new Error("An unknown error occurred whilst processing the image.");}return result;};/**
|
|
99296
|
+
if(!(imageData instanceof Uint8Array)&&format!=="RGBA"){dataAsBinaryString=imageData;imageData=binaryStringToUint8Array(imageData);}}result=this["process"+format.toUpperCase()](imageData,getImageIndex.call(this),alias,checkCompressValue(compression),dataAsBinaryString);}if(!result){throw new Error("An unknown error occurred whilst processing the image.");}result.exifdata=exifdata;return result;};/**
|
|
98191
99297
|
* @name convertBase64ToBinaryString
|
|
98192
99298
|
* @function
|
|
98193
99299
|
* @param {string} stringData
|
|
@@ -98980,7 +100086,7 @@ a=isNaN(a)?1:a;b=isNaN(b)?0:b;c=isNaN(c)?0:c;d=isNaN(d)?1:d;e=isNaN(e)?0:e;f=isN
|
|
|
98980
100086
|
* @param y {Number} The y coordinate where to place the image on the canvas
|
|
98981
100087
|
* @param width {Number} Optional. The width of the image to use (stretch or reduce the image)
|
|
98982
100088
|
* @param height {Number} Optional. The height of the image to use (stretch or reduce the image)
|
|
98983
|
-
*/Context2D.prototype.drawImage=function(img,sx,sy,swidth,sheight,x,y,width,height){var imageProperties=this.pdf.getImageProperties(img);var factorX=1;var factorY=1;var clipFactorX=1;var clipFactorY=1;if(typeof swidth!=="undefined"&&typeof width!=="undefined"){clipFactorX=width/swidth;clipFactorY=height/sheight;factorX=imageProperties.width/swidth*width/swidth;factorY=imageProperties.height/sheight*height/sheight;}//is sx and sy are set and x and y not, set x and y with values of sx and sy
|
|
100089
|
+
*/Context2D.prototype.drawImage=function(img,sx,sy,swidth,sheight,x,y,width,height){var imageProperties=this.pdf.getImageProperties(img);if(img.exifdata){imageProperties.exifdata=img.exifdata;}var factorX=1;var factorY=1;var clipFactorX=1;var clipFactorY=1;if(typeof swidth!=="undefined"&&typeof width!=="undefined"){clipFactorX=width/swidth;clipFactorY=height/sheight;factorX=imageProperties.width/swidth*width/swidth;factorY=imageProperties.height/sheight*height/sheight;}//is sx and sy are set and x and y not, set x and y with values of sx and sy
|
|
98984
100090
|
if(typeof x==="undefined"){x=sx;y=sy;sx=0;sy=0;}if(typeof swidth!=="undefined"&&typeof width==="undefined"){width=swidth;height=sheight;}if(typeof swidth==="undefined"&&typeof width==="undefined"){width=imageProperties.width;height=imageProperties.height;}var decomposedTransformationMatrix=this.ctx.transform.decompose();// console.log("transform.decompose",decomposedTransformationMatrix.scale);
|
|
98985
100091
|
// 自定义修改 修复图片旋转角度错误问题
|
|
98986
100092
|
var angle=rad2deg(decomposedTransformationMatrix.rotate.rotation);var matrix=new Matrix();matrix=matrix.multiply(decomposedTransformationMatrix.translate);matrix=matrix.multiply(decomposedTransformationMatrix.skew);matrix=matrix.multiply(decomposedTransformationMatrix.scale);if(!swidth){swidth=width;}if(!sheight){sheight=height;}var xRect;// 自定义修改 处理签名图片打印和普通图片打印
|
|
@@ -106826,7 +107932,8 @@ this.createjs=this.createjs||{};(function(){/**
|
|
|
106826
107932
|
* For example, used for drawing the cache (to prevent it from simply drawing an existing cache back
|
|
106827
107933
|
* into itself).
|
|
106828
107934
|
* @return {Boolean}
|
|
106829
|
-
**/p.draw=function(ctx,ignoreCache){if(this.DisplayObject_draw(ctx,ignoreCache)){return true;}var img=this.image,rect=this.sourceRect
|
|
107935
|
+
**/p.draw=function(ctx,ignoreCache){if(this.DisplayObject_draw(ctx,ignoreCache)){return true;}var img=this.image,rect=this.sourceRect;// if (img.getImage) { img = img.getImage(); }
|
|
107936
|
+
if(!img){return true;}if(rect){// some browsers choke on out of bound values, so we'll fix them:
|
|
106830
107937
|
var x1=rect.x,y1=rect.y,x2=x1+rect.width,y2=y1+rect.height,x=0,y=0,w=img.width,h=img.height;if(x1<0){x-=x1;x1=0;}if(x2>w){x2=w;}if(y1<0){y-=y1;y1=0;}if(y2>h){y2=h;}ctx.drawImage(img,x1,y1,x2-x1,y2-y1,x,y,x2-x1,y2-y1);}else{ctx.drawImage(img,0,0);}return true;};//Note, the doc sections below document using the specified APIs (from DisplayObject) from
|
|
106831
107938
|
//Bitmap. This is why they have no method implementations.
|
|
106832
107939
|
/**
|
|
@@ -237833,7 +238940,7 @@ var ParagraphNode = __webpack_require__(67945);
|
|
|
237833
238940
|
// EXTERNAL MODULE: ./src/editor/dom/treeNode/MarkNode.ts
|
|
237834
238941
|
var MarkNode = __webpack_require__(57727);
|
|
237835
238942
|
;// CONCATENATED MODULE: ./src/components/version.ts
|
|
237836
|
-
/* harmony default export */ var version = ('3.0.
|
|
238943
|
+
/* harmony default export */ var version = ('3.0.83');
|
|
237837
238944
|
// EXTERNAL MODULE: ./src/components/controls/poperTipText/PoperTipText.vue + 5 modules
|
|
237838
238945
|
var PoperTipText = __webpack_require__(36081);
|
|
237839
238946
|
;// CONCATENATED MODULE: ./src/components/controls/poperTipText/index.ts
|
|
@@ -250023,12 +251130,12 @@ var VueController = /*#__PURE__*/function () {
|
|
|
250023
251130
|
}
|
|
250024
251131
|
}
|
|
250025
251132
|
if (!isNaN(min) && isNaN(max)) {
|
|
250026
|
-
if (nodeValue
|
|
251133
|
+
if (nodeValue < min) {
|
|
250027
251134
|
verifyTipList.push(value.tip);
|
|
250028
251135
|
}
|
|
250029
251136
|
}
|
|
250030
251137
|
if (isNaN(min) && !isNaN(max)) {
|
|
250031
|
-
if (nodeValue
|
|
251138
|
+
if (nodeValue > max) {
|
|
250032
251139
|
verifyTipList.push(value.tip);
|
|
250033
251140
|
}
|
|
250034
251141
|
}
|