File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,18 @@ $(function () {
120120 *
121121 * @param {* } img Image or canvas element
122122 * @param {object } [data] Metadata object
123+ * @param {boolean } [keepMetaData] Keep meta data if true
123124 */
124- function updateResults ( img , data ) {
125- removeMetaData ( )
125+ function updateResults ( img , data , keepMetaData ) {
126+ if ( ! keepMetaData ) {
127+ removeMetaData ( )
128+ if ( data ) {
129+ if ( img . getContext ) {
130+ actionsNode . show ( )
131+ }
132+ displayMetaData ( data )
133+ }
134+ }
126135 if ( ! ( img . src || img instanceof HTMLCanvasElement ) ) {
127136 resultNode
128137 . children ( )
@@ -131,15 +140,6 @@ $(function () {
131140 }
132141 var content = $ ( '<a></a>' ) . append ( img )
133142 resultNode . children ( ) . replaceWith ( content )
134- if ( data ) {
135- if ( img . getContext ) {
136- actionsNode . show ( )
137- }
138- displayMetaData ( data )
139- } else {
140- // eslint-disable-next-line no-param-reassign
141- data = metaNode . data ( )
142- }
143143 if ( data . imageHead ) {
144144 if ( data . exif ) {
145145 // Reset Exif Orientation data:
@@ -241,7 +241,9 @@ $(function () {
241241 pixelRatio : window . devicePixelRatio ,
242242 orientation : Number ( orientationNode . val ( ) ) || true ,
243243 imageSmoothingEnabled : imageSmoothingNode . is ( ':checked' )
244- } )
244+ } ) ,
245+ metaNode . data ( ) ,
246+ true
245247 )
246248 }
247249 } )
@@ -294,7 +296,9 @@ $(function () {
294296 contain : true ,
295297 pixelRatio : pixelRatio ,
296298 imageSmoothingEnabled : imageSmoothingNode . is ( ':checked' )
297- } )
299+ } ) ,
300+ metaNode . data ( ) ,
301+ true
298302 )
299303 coordinates = null
300304 }
You can’t perform that action at this time.
0 commit comments