Mdale has submitted this change and it was merged.

Change subject: (bug 45118) really dont try to convert images
......................................................................


(bug 45118) really dont try to convert images

dont try to convert images even if they look like audio files.
also dont fail if file can not be parsed at all.

Change-Id: I5748e0806ada4d7f55b77bff77f621bc6586746e
---
M resources/mw.FirefoggTransport.js
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Mdale: Verified; Looks good to me, approved



diff --git a/resources/mw.FirefoggTransport.js 
b/resources/mw.FirefoggTransport.js
index 5e21126..302f517 100644
--- a/resources/mw.FirefoggTransport.js
+++ b/resources/mw.FirefoggTransport.js
@@ -80,7 +80,11 @@
 
        isSourceAudio: function() {
                var info = this.getSourceFileInfo();
-               return ( info.video.length == 0 && info.audio.length > 0 )
+               // never transcode images
+               if ( info.contentType.indexOf( "image/" ) != -1 ) {
+                       return false;
+               }
+               return ( (!info.video || info.video.length == 0) && 
info.audio.length > 0 )
                        || info.contentType.indexOf( "audio/" ) != -1;
        },
 
@@ -90,7 +94,7 @@
                if ( info.contentType.indexOf( "image/" ) != -1 ) {
                        return false;
                }
-               return ( info.video.length > 0 && info.video[0].duration > 0.04 
)
+               return ( info.video && info.video.length > 0 && 
info.video[0].duration > 0.04 )
                        || info.contentType.indexOf( "video/" ) != -1;
        },
 

-- 
To view, visit https://gerrit.wikimedia.org/r/49690
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5748e0806ada4d7f55b77bff77f621bc6586746e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: J <jger...@wikimedia.org>
Gerrit-Reviewer: Mdale <md...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to