documentcloud / docsplit

Break Apart Documents into Images, Text, Pages and PDFs
http://documentcloud.github.com/docsplit/
Other
832 stars 214 forks source link

TransparentPDFs should not only check for file extension but also for Mime Type #98

Closed tmaier closed 10 years ago

tmaier commented 10 years ago

Currently, TransparentPDFs would try to convert a file to pdf if the file extension ".pdf" is not available.

https://github.com/documentcloud/docsplit/blob/master/lib/docsplit/transparent_pdfs.rb

But a file does not necessarily need a file extension. It could also provide a valid mime type.

Docsplit could use a gem, like https://rubygems.org/gems/mime-types for this.