@digabi/exam-engine-core 19.7.1-alpha.0 → 19.8.0-alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/AnsweringInstructions.test.js +11 -11
- package/dist/__tests__/AnsweringInstructions.test.js.map +1 -1
- package/dist/__tests__/examServerApi.js +2 -2
- package/dist/__tests__/examServerApi.js.map +1 -1
- package/dist/__tests__/renderAnnotations.test.js +18 -18
- package/dist/__tests__/results/AnnotationList.test.js +27 -27
- package/dist/__tests__/results/ResultsContext.test.js +37 -37
- package/dist/__tests__/results/ResultsContext.test.js.map +1 -1
- package/dist/__tests__/results/ResultsExamQuestionAutoScore.test.js +4 -4
- package/dist/__tests__/results/ResultsExamQuestionManualScore.test.js +19 -19
- package/dist/__tests__/testExamRendering.js +14 -16
- package/dist/__tests__/testExamRendering.js.map +1 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/__tests__/validateAnswers.test.js +28 -28
- package/dist/__tests__/validateAnswers.test.js.map +1 -1
- package/dist/components/AnswerToolbar.d.ts +1 -1
- package/dist/components/AnswerToolbar.d.ts.map +1 -1
- package/dist/components/AnswerToolbar.js +2 -2
- package/dist/components/AnswerToolbar.js.map +1 -1
- package/dist/components/AnsweringInstructions.js +1 -1
- package/dist/components/AnsweringInstructions.js.map +1 -1
- package/dist/components/DocumentTitle.js +1 -1
- package/dist/components/DocumentTitle.js.map +1 -1
- package/dist/components/SectionElement.js +1 -1
- package/dist/components/SectionElement.js.map +1 -1
- package/dist/components/attachments/Attachments.js +1 -1
- package/dist/components/attachments/ExternalMaterial.d.ts.map +1 -1
- package/dist/components/attachments/ExternalMaterial.js +5 -1
- package/dist/components/attachments/ExternalMaterial.js.map +1 -1
- package/dist/components/attachments/Question.js +1 -1
- package/dist/components/attachments/Question.js.map +1 -1
- package/dist/components/context/CommonExamContext.js +1 -1
- package/dist/components/context/ExamContext.js +1 -1
- package/dist/components/context/QuestionContext.js +1 -1
- package/dist/components/context/ResultsContext.js +6 -6
- package/dist/components/context/ResultsContext.js.map +1 -1
- package/dist/components/context/SectionContext.js +2 -2
- package/dist/components/context/SectionContext.js.map +1 -1
- package/dist/components/exam/ChoiceAnswer.js +6 -6
- package/dist/components/exam/ChoiceAnswer.js.map +1 -1
- package/dist/components/exam/DropdownAnswer.js +10 -10
- package/dist/components/exam/DropdownAnswer.js.map +1 -1
- package/dist/components/exam/Exam.d.ts.map +1 -1
- package/dist/components/exam/Exam.js +11 -7
- package/dist/components/exam/Exam.js.map +1 -1
- package/dist/components/exam/ExternalMaterial.js +1 -1
- package/dist/components/exam/Hints.js +3 -3
- package/dist/components/exam/Hints.js.map +1 -1
- package/dist/components/exam/Question.d.ts +4 -0
- package/dist/components/exam/Question.d.ts.map +1 -1
- package/dist/components/exam/Question.js +41 -8
- package/dist/components/exam/Question.js.map +1 -1
- package/dist/components/exam/QuestionTitle.js +1 -1
- package/dist/components/exam/RichTextAnswer.d.ts +6 -1
- package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
- package/dist/components/exam/RichTextAnswer.js +14 -2
- package/dist/components/exam/RichTextAnswer.js.map +1 -1
- package/dist/components/exam/Section.js +2 -2
- package/dist/components/exam/Section.js.map +1 -1
- package/dist/components/exam/internal/ErrorIndicator.d.ts +1 -1
- package/dist/components/exam/internal/ErrorIndicator.d.ts.map +1 -1
- package/dist/components/exam/internal/ErrorIndicator.js +4 -4
- package/dist/components/exam/internal/ErrorIndicator.js.map +1 -1
- package/dist/components/exam/internal/ProgressBar.js +1 -1
- package/dist/components/exam/internal/ProgressBar.js.map +1 -1
- package/dist/components/exam/internal/TextAnswerInput.d.ts.map +1 -1
- package/dist/components/exam/internal/TextAnswerInput.js +42 -12
- package/dist/components/exam/internal/TextAnswerInput.js.map +1 -1
- package/dist/components/grading/AnswerCharacterCounter.d.ts +1 -1
- package/dist/components/grading/AnswerCharacterCounter.d.ts.map +1 -1
- package/dist/components/grading/AnswerCharacterCounter.js +3 -3
- package/dist/components/grading/AnswerCharacterCounter.js.map +1 -1
- package/dist/components/grading/GradingAnswer.js +9 -9
- package/dist/components/grading/GradingAnswer.js.map +1 -1
- package/dist/components/grading/GradingAnswerAnnotationList.d.ts +1 -1
- package/dist/components/grading/GradingAnswerAnnotationList.d.ts.map +1 -1
- package/dist/components/grading/GradingAnswerAnnotationList.js +2 -2
- package/dist/components/grading/GradingAnswerAnnotationList.js.map +1 -1
- package/dist/components/grading/editAnnotations.js +14 -14
- package/dist/components/grading/editAnnotations.js.map +1 -1
- package/dist/components/grading/largeImageDetector.js +2 -2
- package/dist/components/grading/largeImageDetector.js.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.js +7 -3
- package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
- package/dist/components/grading-instructions/Question.js +1 -1
- package/dist/components/grading-instructions/QuestionTitle.js +1 -1
- package/dist/components/results/ChoiceAnswer.js +7 -7
- package/dist/components/results/ChoiceAnswer.js.map +1 -1
- package/dist/components/results/DropdownAnswer.js +5 -5
- package/dist/components/results/DropdownAnswer.js.map +1 -1
- package/dist/components/results/Question.js +3 -3
- package/dist/components/results/Question.js.map +1 -1
- package/dist/components/results/QuestionTitle.js +1 -1
- package/dist/components/results/Results.d.ts.map +1 -1
- package/dist/components/results/Results.js +5 -1
- package/dist/components/results/Results.js.map +1 -1
- package/dist/components/results/Section.js +1 -1
- package/dist/components/results/Section.js.map +1 -1
- package/dist/components/results/SingleLineAnswer.d.ts +1 -1
- package/dist/components/results/SingleLineAnswer.d.ts.map +1 -1
- package/dist/components/results/SingleLineAnswer.js +1 -1
- package/dist/components/results/SingleLineAnswer.js.map +1 -1
- package/dist/components/results/internal/AnnotationList.js +2 -2
- package/dist/components/results/internal/AnnotationList.js.map +1 -1
- package/dist/components/results/internal/QuestionAutoScore.js +1 -1
- package/dist/components/results/internal/QuestionAutoScore.js.map +1 -1
- package/dist/components/results/internal/QuestionManualScore.js +3 -3
- package/dist/components/results/internal/QuestionScoresContainer.d.ts +1 -1
- package/dist/components/results/internal/QuestionScoresContainer.d.ts.map +1 -1
- package/dist/components/results/internal/QuestionScoresContainer.js +4 -4
- package/dist/components/results/internal/QuestionScoresContainer.js.map +1 -1
- package/dist/components/shared/AnnotationLists.d.ts +1 -1
- package/dist/components/shared/AnnotationLists.d.ts.map +1 -1
- package/dist/components/shared/AnnotationLists.js +1 -1
- package/dist/components/shared/AnnotationLists.js.map +1 -1
- package/dist/components/shared/AnswerIndicator.js +1 -1
- package/dist/components/shared/AttachmentLink.js +1 -1
- package/dist/components/shared/AttachmentLink.js.map +1 -1
- package/dist/components/shared/AttachmentLinks.js +3 -3
- package/dist/components/shared/AttachmentLinks.js.map +1 -1
- package/dist/components/shared/ImageOverlay.js +3 -3
- package/dist/components/shared/ImageOverlay.js.map +1 -1
- package/dist/components/shared/Reference.js +1 -1
- package/dist/components/shared/References.js +1 -1
- package/dist/components/shared/References.js.map +1 -1
- package/dist/components/shared/Score.js +1 -1
- package/dist/components/shared/TableOfContents.js +15 -17
- package/dist/components/shared/TableOfContents.js.map +1 -1
- package/dist/components/shared/internal/ResponsiveMediaContainer.js +3 -3
- package/dist/components/shared/internal/ResponsiveMediaContainer.js.map +1 -1
- package/dist/components/shared/internal/RestrictedAudioPlayer.d.ts +1 -1
- package/dist/components/shared/internal/RestrictedAudioPlayer.d.ts.map +1 -1
- package/dist/components/shared/internal/RestrictedAudioPlayer.js +2 -2
- package/dist/components/shared/internal/RestrictedAudioPlayer.js.map +1 -1
- package/dist/dom-utils.js +1 -1
- package/dist/dom-utils.js.map +1 -1
- package/dist/fonts.js +1 -1
- package/dist/fonts.js.map +1 -1
- package/dist/i18n/A_E.js +2 -2
- package/dist/i18n/BA.js +1 -1
- package/dist/i18n/CA.js +1 -1
- package/dist/i18n/EA.js +2 -2
- package/dist/i18n/FA.js +2 -2
- package/dist/i18n/GC.js +2 -2
- package/dist/i18n/I.js +3 -3
- package/dist/i18n/M.js +1 -1
- package/dist/i18n/O_E.js +2 -2
- package/dist/i18n/PA.js +2 -2
- package/dist/i18n/SA.js +2 -2
- package/dist/i18n/TC.js +2 -2
- package/dist/i18n/VA.js +2 -2
- package/dist/i18n/Z.js +3 -3
- package/dist/i18n/fi-FI.d.ts +3 -0
- package/dist/i18n/fi-FI.d.ts.map +1 -1
- package/dist/i18n/fi-FI.js +17 -14
- package/dist/i18n/fi-FI.js.map +1 -1
- package/dist/i18n/index.d.ts +2 -137
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +8 -8
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/sv-FI.d.ts.map +1 -1
- package/dist/i18n/sv-FI.js +18 -14
- package/dist/i18n/sv-FI.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main-bundle.js.LICENSE.txt +0 -5
- package/dist/main.css +1 -1
- package/dist/parser/parseExam.js +5 -5
- package/dist/parser/parseExam.js.map +1 -1
- package/dist/parser/parseExamStructure.js +4 -4
- package/dist/renderAnnotations.js +8 -8
- package/dist/renderAnnotations.js.map +1 -1
- package/dist/store/answers/reducer.js +2 -2
- package/dist/store/audio/reducer.js +3 -3
- package/dist/store/audio/sagas.js +1 -1
- package/dist/store/audio/sagas.js.map +1 -1
- package/dist/store/cas/reducer.js +1 -1
- package/dist/store/cas/sagas.js +1 -1
- package/dist/store/countdown.js +1 -1
- package/dist/store/countdown.js.map +1 -1
- package/dist/store/index.js +4 -4
- package/dist/validateAnswers.js +8 -8
- package/dist/validateAnswers.js.map +1 -1
- package/package.json +18 -18
- package/dist/utils/exifDataAndImageHandler.d.ts +0 -2
- package/dist/utils/exifDataAndImageHandler.d.ts.map +0 -1
- package/dist/utils/exifDataAndImageHandler.js +0 -61
- package/dist/utils/exifDataAndImageHandler.js.map +0 -1
package/dist/validateAnswers.js
CHANGED
@@ -17,8 +17,8 @@ function validateAnswerLength(examStructure, answersById) {
|
|
17
17
|
type: 'AnswerTooLong',
|
18
18
|
displayNumber: element.attributes.displayNumber,
|
19
19
|
characterCount: maybeAnswer.characterCount,
|
20
|
-
elementType: 'question'
|
21
|
-
}
|
20
|
+
elementType: 'question'
|
21
|
+
}
|
22
22
|
]
|
23
23
|
: errors;
|
24
24
|
}
|
@@ -40,7 +40,7 @@ function validateExtraAnswers(examStructure, answersById) {
|
|
40
40
|
case 'section':
|
41
41
|
case 'question': {
|
42
42
|
const children = element.childNodes.map(go);
|
43
|
-
const childrenWithAnswers = children.filter(
|
43
|
+
const childrenWithAnswers = children.filter(v => v.answerCount > 0);
|
44
44
|
const maxAnswers = (_a = element.attributes.maxAnswers) !== null && _a !== void 0 ? _a : Infinity;
|
45
45
|
// Currently, min-answers exists only at section level.
|
46
46
|
const minAnswers = element.name === 'section' ? element.attributes.minAnswers : undefined;
|
@@ -50,7 +50,7 @@ function validateExtraAnswers(examStructure, answersById) {
|
|
50
50
|
const answerCount = element.name === 'exam'
|
51
51
|
? childrenWithAnswers.reduce((acc, section) => acc + section.answerCount, 0)
|
52
52
|
: childrenWithAnswers.length;
|
53
|
-
const childExtraAnswers = _.flatMap(children,
|
53
|
+
const childExtraAnswers = _.flatMap(children, v => v.extraAnswers);
|
54
54
|
// If there are extra answers on the current level, we prepend them to
|
55
55
|
// the extra answers array, so it is ordered naturally in document
|
56
56
|
// order.
|
@@ -60,11 +60,11 @@ function validateExtraAnswers(examStructure, answersById) {
|
|
60
60
|
type: 'ExtraAnswer',
|
61
61
|
elementType: element.name,
|
62
62
|
displayNumber,
|
63
|
-
childQuestions: children.map(
|
63
|
+
childQuestions: children.map(v => v.displayNumber),
|
64
64
|
maxAnswers,
|
65
|
-
minAnswers
|
65
|
+
minAnswers
|
66
66
|
},
|
67
|
-
...childExtraAnswers
|
67
|
+
...childExtraAnswers
|
68
68
|
]
|
69
69
|
: childExtraAnswers;
|
70
70
|
return { answerCount, displayNumber, extraAnswers };
|
@@ -84,6 +84,6 @@ function validateExtraAnswers(examStructure, answersById) {
|
|
84
84
|
return go(examStructure).extraAnswers;
|
85
85
|
}
|
86
86
|
export function validateAnswers(examStructure, answersById) {
|
87
|
-
return _.flatMap([validateAnswerLength, validateExtraAnswers],
|
87
|
+
return _.flatMap([validateAnswerLength, validateExtraAnswers], validationFn => validationFn(examStructure, answersById));
|
88
88
|
}
|
89
89
|
//# sourceMappingURL=validateAnswers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validateAnswers.js","sourceRoot":"","sources":["../src/validateAnswers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAiB9B,SAAS,UAAU,CACjB,aAA0B,EAC1B,OAAoD,EACpD,YAAe;IAEf,SAAS,EAAE,CAAC,WAAc,EAAE,OAAoB;QAC9C,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;IACrE,CAAC;IAED,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;AACxC,CAAC;AAED,SAAS,oBAAoB,CAC3B,aAA0B,EAC1B,WAA2C;IAE3C,OAAO,UAAU,CACf,aAAa,EACb,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QAClB,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,IAAI,IAAI,EAAE;YAC1E,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;YAC9D,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,UAAU,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,MAAM,EAAE;gBACpE,OAAO,WAAW,CAAC,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS;oBAC9D,CAAC,CAAC;wBACE,GAAG,MAAM;wBACT;4BACE,IAAI,EAAE,eAAe;4BACrB,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,aAA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Ae,CAAC;YACrB,KAAK,iBAAiB,CAAC,CAAC;gBACtB,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;gBAC9D,sEAAsE;gBACtE,QAAQ;gBACR,MAAM,aAAa,GAAG,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAC,MAAM,IAAG,CAAC,CAAA;gBACnD,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE,CAAA;aAC/E;SACF;IACH,CAAC;IAED,OAAO,EAAE,CAAC,aAAa,CAAC,CAAC,YAAY,CAAA;AACvC,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,aAA0B,EAC1B,WAA2C;IAE3C,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,EAAE,YAAY,CAAC,EAAE,CAC5E,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CACzC,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@digabi/exam-engine-core",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.8.0-alpha.3",
|
4
4
|
"main": "dist/main-bundle.js",
|
5
5
|
"types": "dist/index.d.ts",
|
6
6
|
"author": "Matriculation Examination Board, Finland",
|
@@ -19,21 +19,21 @@
|
|
19
19
|
"prepublishOnly": "webpack --mode=production && perl -pi -e 's|&&define.amd||' dist/main-bundle.js # Compatibility with our 💩 AMD loader"
|
20
20
|
},
|
21
21
|
"peerDependencies": {
|
22
|
-
"react": "^
|
22
|
+
"react": "^18.2.0"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
25
|
"@digabi/noto-sans": "^2.1.0",
|
26
|
-
"@fortawesome/fontawesome-svg-core": "^
|
27
|
-
"@fortawesome/free-solid-svg-icons": "^
|
26
|
+
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
27
|
+
"@fortawesome/free-solid-svg-icons": "^6.4.0",
|
28
28
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
29
29
|
"classnames": "^2.2.6",
|
30
30
|
"css-loader": "^5.0.0",
|
31
|
-
"css-minimizer-webpack-plugin": "^
|
31
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
32
32
|
"date-fns": "^2.8.1",
|
33
|
-
"downshift": "^
|
33
|
+
"downshift": "^8.0.0",
|
34
34
|
"file-loader": "^6.1.0",
|
35
35
|
"fontfaceobserver": "^2.1.0",
|
36
|
-
"i18next": "^
|
36
|
+
"i18next": "^23.2.11",
|
37
37
|
"jquery": "^3.4.1",
|
38
38
|
"less": "^4.1.0",
|
39
39
|
"less-loader": "^11.0.0",
|
@@ -42,16 +42,16 @@
|
|
42
42
|
"optimize-css-assets-webpack-plugin": "^6.0.0",
|
43
43
|
"postcss": "^8.0.5",
|
44
44
|
"postcss-loader": "^7.0.0",
|
45
|
-
"postcss-preset-env": "^
|
46
|
-
"react": "^
|
47
|
-
"react-css-transition-replace": "^
|
48
|
-
"react-dom": "^
|
49
|
-
"react-i18next": "^
|
50
|
-
"react-redux": "^8.
|
51
|
-
"react-test-renderer": "^
|
52
|
-
"redux": "^4.
|
53
|
-
"redux-saga": "^1.
|
54
|
-
"redux-saga-test-plan": "^4.0.
|
45
|
+
"postcss-preset-env": "^9.1.0",
|
46
|
+
"react": "^18.2.0",
|
47
|
+
"react-css-transition-replace": "^5.0.1",
|
48
|
+
"react-dom": "^18.2.0",
|
49
|
+
"react-i18next": "^13.0.2",
|
50
|
+
"react-redux": "^8.1.1",
|
51
|
+
"react-test-renderer": "^18.2.0",
|
52
|
+
"redux": "^4.2.1",
|
53
|
+
"redux-saga": "^1.2.3",
|
54
|
+
"redux-saga-test-plan": "^4.0.6",
|
55
55
|
"rich-text-editor": "^7.1.6",
|
56
56
|
"sanitize-html": "^2.0.0",
|
57
57
|
"typesafe-actions": "^5.1.0",
|
@@ -60,5 +60,5 @@
|
|
60
60
|
"webpack-bundle-analyzer": "^4.1.0",
|
61
61
|
"webpack-cli": "^5.0.2"
|
62
62
|
},
|
63
|
-
"gitHead": "
|
63
|
+
"gitHead": "e9655ebb690ee0b2bfa54b6e60fc3f9db2268994"
|
64
64
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"exifDataAndImageHandler.d.ts","sourceRoot":"","sources":["../../src/utils/exifDataAndImageHandler.ts"],"names":[],"mappings":"AAKA,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAc7E"}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import path from 'path';
|
2
|
-
import tmp from 'tmp-promise';
|
3
|
-
import { readFileSync, writeFileSync } from 'fs';
|
4
|
-
import { load, insert, dump, remove, TagValues } from 'piexif-ts';
|
5
|
-
export async function createFileWithCleanExif(source) {
|
6
|
-
const cacheDirectory = await tmp.dir({ unsafeCleanup: true }).then((d) => d.path);
|
7
|
-
const newFileSource = `${cacheDirectory}/${path.parse(source).base}`;
|
8
|
-
const imageData = function (src) {
|
9
|
-
return readFileSync(src).toString('binary');
|
10
|
-
};
|
11
|
-
const data = load(imageData(source));
|
12
|
-
const cleanExifData = createCleanExif(data);
|
13
|
-
const imageBinary = remove(imageData(source));
|
14
|
-
const newExifBinary = dump(cleanExifData);
|
15
|
-
const newImageBinary = insert(newExifBinary, imageBinary);
|
16
|
-
writeFileSync(newFileSource, newImageBinary, { encoding: 'binary' });
|
17
|
-
return newFileSource;
|
18
|
-
}
|
19
|
-
function createCleanExif(exifSource) {
|
20
|
-
const newExifData = { ...exifSource };
|
21
|
-
if (newExifData && newExifData['0th']) {
|
22
|
-
newExifData['0th'][TagValues.ImageIFD.DocumentName] = '';
|
23
|
-
newExifData['0th'][TagValues.ImageIFD.ImageDescription] = '';
|
24
|
-
newExifData['0th'][TagValues.ImageIFD.Make] = '';
|
25
|
-
newExifData['0th'][TagValues.ImageIFD.Model] = '';
|
26
|
-
newExifData['0th'][TagValues.ImageIFD.Software] = '';
|
27
|
-
newExifData['0th'][TagValues.ImageIFD.DateTime] = '';
|
28
|
-
newExifData['0th'][TagValues.ImageIFD.Artist] = '';
|
29
|
-
newExifData['0th'][TagValues.ImageIFD.HostComputer] = '';
|
30
|
-
newExifData['0th'][TagValues.ImageIFD.Copyright] = '';
|
31
|
-
newExifData['0th'][TagValues.ImageIFD.ExposureTime] = [[0]];
|
32
|
-
newExifData['0th'][TagValues.ImageIFD.TimeZoneOffset] = [0];
|
33
|
-
newExifData['0th'][TagValues.ImageIFD.XPKeywords] = [0];
|
34
|
-
newExifData['0th'][TagValues.ImageIFD.XPTitle] = [0];
|
35
|
-
newExifData['0th'][TagValues.ImageIFD.XPComment] = [0];
|
36
|
-
newExifData['0th'][TagValues.ImageIFD.XPAuthor] = [0];
|
37
|
-
newExifData['0th'][TagValues.ImageIFD.XPSubject] = [0];
|
38
|
-
newExifData['0th'][TagValues.ImageIFD.LocalizedCameraModel] = [0];
|
39
|
-
newExifData['0th'][TagValues.ImageIFD.CameraSerialNumber] = '';
|
40
|
-
newExifData['0th'][TagValues.ImageIFD.MakerNoteSafety] = [0];
|
41
|
-
newExifData['0th'][TagValues.ImageIFD.OriginalRawFileName] = [0];
|
42
|
-
newExifData['0th'][TagValues.ImageIFD.OriginalRawFileData] = '';
|
43
|
-
}
|
44
|
-
if (newExifData && newExifData.Exif) {
|
45
|
-
newExifData.Exif[TagValues.ExifIFD.MakerNote] = '';
|
46
|
-
newExifData.Exif[TagValues.ExifIFD.UserComment] = '';
|
47
|
-
newExifData.Exif[TagValues.ExifIFD.LensMake] = '';
|
48
|
-
newExifData.Exif[TagValues.ExifIFD.LensModel] = '';
|
49
|
-
newExifData.Exif[TagValues.ExifIFD.LensSerialNumber] = '';
|
50
|
-
newExifData.Exif[TagValues.ExifIFD.LensSpecification] = [[0]];
|
51
|
-
newExifData.Exif[TagValues.ExifIFD.CameraOwnerName] = '';
|
52
|
-
newExifData.Exif[TagValues.ExifIFD.BodySerialNumber] = '';
|
53
|
-
newExifData.Exif[TagValues.ExifIFD.DateTimeOriginal] = '';
|
54
|
-
newExifData.Exif[TagValues.ExifIFD.DateTimeDigitized] = '';
|
55
|
-
}
|
56
|
-
if (newExifData && newExifData.GPS) {
|
57
|
-
newExifData.GPS = {};
|
58
|
-
}
|
59
|
-
return newExifData;
|
60
|
-
}
|
61
|
-
//# sourceMappingURL=exifDataAndImageHandler.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"exifDataAndImageHandler.js","sourceRoot":"","sources":["../../src/utils/exifDataAndImageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAChD,OAAO,EAAS,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAExE,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,MAAc;IAC1D,MAAM,cAAc,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACjF,MAAM,aAAa,GAAW,GAAG,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5E,MAAM,SAAS,GAAG,UAAU,GAAW;QACrC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC7C,CAAC,CAAA;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IACpC,MAAM,aAAa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