[Groonga-commit] ranguba/chupa-text-decomposer-pdf at f87d956 [master] Check body for detecting PDF

Back to archive index

Kouhei Sutou null+****@clear*****
Tue May 2 12:45:30 JST 2017


Kouhei Sutou	2017-05-02 12:45:30 +0900 (Tue, 02 May 2017)

  New Revision: f87d956f178cea136fa17f4cc2af1e58b3e71e86
  https://github.com/ranguba/chupa-text-decomposer-pdf/commit/f87d956f178cea136fa17f4cc2af1e58b3e71e86

  Message:
    Check body for detecting PDF

  Modified files:
    lib/chupa-text/decomposers/pdf.rb

  Modified: lib/chupa-text/decomposers/pdf.rb (+1 -2)
===================================================================
--- lib/chupa-text/decomposers/pdf.rb    2017-05-02 12:37:03 +0900 (aa6746e)
+++ lib/chupa-text/decomposers/pdf.rb    2017-05-02 12:45:30 +0900 (cfd86ed)
@@ -24,8 +24,7 @@ module ChupaText
       registry.register("pdf", self)
 
       def target?(data)
-        return false if data.text_plain?
-        data.extension == "pdf" or
+        (data.extension == "pdf" and data.body.start_with?("%PDF-1")) or
           data.mime_type == "application/pdf"
       end
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index