PDF magic in 0.1.8 is too loose #4

Closed
bronson opened this Issue Jun 3, 2011 · 4 comments

Projects

None yet

2 participants

@bronson
Contributor
bronson commented Jun 3, 2011

I'm stuck on mimemagic 0.1.7 because of the new PDF magic.

This change is the problem:

-    ['application/pdf', [[0, "%PDF-"]]],
+    ['application/pdf', [[0..1024, "%PDF-"]]],

Turns out LOTS of files have %PDF- in the first 1024 bytes. Here are two:

Is there a way to report this broken magic upstream?

(I originally commented on the commit)

@minad
Owner
minad commented Jun 3, 2011

The magic file is automatically generated from the freedesktop mime database. But it might be possible to add a "patch table file" which won't be overwritten when the magic database is updated. Patches welcome!

@bronson
Contributor
bronson commented Jun 3, 2011

Is there any way to tell FreeDesktop that their mime database is broken? It seems best to fix the problem at the source.

If not then I guess a patch table is the way to go. It would fix the other open issue too.

@minad
Owner
minad commented Mar 21, 2015

Still an issue?

We now have mimemagic/overlay, but I would prefer upstream fixes.

@minad minad closed this Mar 21, 2015
@bronson
Contributor
bronson commented Oct 7, 2016

Hi, sorry I missed this. Yep, still an issue:

https://github.com/minad/mimemagic/blob/master/lib/mimemagic/tables.rb#L1522

I'll add an overlay if needed, thanks! So far, remaining on 0.1.7 has been fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment