-
Notifications
You must be signed in to change notification settings - Fork 163
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
.zip incorrectly detected as .xlsx possible regression #400
Comments
gabriel-vasile
added a commit
that referenced
this issue
Oct 8, 2024
https://github.com/file/file/blob/7c62d696b06e53fc5be015c41a57513278ac6c54/magic/Magdir/msooxml The algorithms is not 100% percent reliable. For example, a zero compression zip containing a docx will still sometimes be detected as docx instead of zip (it depends on how many files and the order of files in the zip) Second thing in this PR is removing some test data fixtures. From now, I'll try as much as possible to write regular unit tests without relying on test file fixtures. #575 (comment) related #550 #575 closes #400
gabriel-vasile
added a commit
that referenced
this issue
Oct 8, 2024
* Make mso detection work similar to what file/file does https://github.com/file/file/blob/7c62d696b06e53fc5be015c41a57513278ac6c54/magic/Magdir/msooxml The algorithms is not 100% percent reliable. For example, a zero compression zip containing a docx will still sometimes be detected as docx instead of zip (it depends on how many files and the order of files in the zip) Second thing in this PR is removing some test data fixtures. From now, I'll try as much as possible to write regular unit tests without relying on test file fixtures. #575 (comment) related #550 #575 closes #400 * zipContains: remove unnecessary zip sig check The check is already done in parent function.
gabriel-vasile
added a commit
that referenced
this issue
Oct 10, 2024
https://github.com/file/file/blob/7c62d696b06e53fc5be015c41a57513278ac6c54/magic/Magdir/msooxml The algorithms is not 100% percent reliable. For example, a zero compression zip containing a docx will still sometimes be detected as docx instead of zip (it depends on how many files and the order of files in the zip) Second thing in this PR is removing some test data fixtures. From now, I'll try as much as possible to write regular unit tests without relying on test file fixtures. #575 (comment) related #550 #575 closes #400
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected MIME type
application/zip
Returned MIME type
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Version of the library you are using
v1.4.2
Output of
go version
go version go1.20.4 linux/amd64
Additional context
Looks very much like #72. If i zip a .xlsx file without compression its still detected as excel file instead of zip. The file utility detects it fine.
Example File: https://filetransfer.io/data-package/pX0B7n1q#link (edited link)
When zipping with compression this library detects the type correctly.
The text was updated successfully, but these errors were encountered: