-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compatibility is broken with certain types of office documents #35
Comments
Merged
I think there may be a few further inconsistencies with various other file formats. > Marcel::MimeType.for File.open('...')
=> "application/zip" Affected file types Example Files at https://drive.google.com/drive/folders/1124-kGCs5sJ1Ng5pXmIzwQLk1CgnWjb4?usp=sharing |
Thanks, @rocket-turtle, this solves all our inconsistencies |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi - first of all A HUGE THANKS for your recent hard work!
I can't thank you enough for your dedication that saved entire rails community (and of course, myself included) from license problems.
By the way, we have just upgraded our Rails app with marcel 1.0.0, and found that some tests started failing due to mis-detection of xlsx formats.
summary
after some investigation, it turned out that the files are all generated by google sheet (by exporting original google sheets as xlsx)
the files seem to have valid xlsx format, because it can be viewed correctly by ms excel.
reproduction case
To reproduce above case, let me submit a PR separately with mis-detected files attached as fixture.
quick analysis and a few thoughts..
It looks like the parts that consists of office open document doesn't have a fixed order.
So in some cases,
[Contents_Type].xml
doesn't come immediately after the first 30 bytes.Currently marcel is very specific about where to expect
[Contents_Type].xml
, whereas mimemagic used to look up wider ranges to find the part.Would that make sense to relax the area for magic match, so that it can detect much varied xlsx's?
The text was updated successfully, but these errors were encountered: