From 52b95bfc032a7602227db7784bf3deab89bab012 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 18 Oct 2013 16:41:04 -0400 Subject: [PATCH] Read 200 bytes instead of 128 in Zotero.File.getSample() This allows Zotero to detect PDFs with more gibberish at the beginning. https://forums.zotero.org/discussion/32550 --- chrome/content/zotero/xpcom/file.js | 4 ++-- chrome/content/zotero/xpcom/mime.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index 9ad7eec4e6..a76278a3ef 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -83,10 +83,10 @@ Zotero.File = new function(){ /* - * Get the first 128 bytes of the file as a string (multibyte-safe) + * Get the first 200 bytes of the file as a string (multibyte-safe) */ function getSample(file) { - return this.getContents(file, null, 128); + return this.getContents(file, null, 200); } diff --git a/chrome/content/zotero/xpcom/mime.js b/chrome/content/zotero/xpcom/mime.js index ca1d50dcf8..0557fd0fa2 100644 --- a/chrome/content/zotero/xpcom/mime.js +++ b/chrome/content/zotero/xpcom/mime.js @@ -233,7 +233,7 @@ Zotero.MIME = new function(){ } } // Otherwise allow match anywhere in sample - // (128 bytes from getSample() by default) + // (200 bytes from getSample() by default) else if (str.indexOf(_snifferEntries[i][0]) != -1) { match = true; }