-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
PDF created with Adobe Illustrator are wrongly detected as .ai files #360
Comments
// @vladfrangu |
Can you send me an AI PDF file please? You can attach it here, email it or send it on Discord if it's easier for you (Vladdy#0002) I'll look into it as soon as I can! 😅 |
I installed Adobe Illustrator's trial and made a few test documents:
|
Well it's good to know out of 6 cases, only one fails 😅 |
True, but it's the one with the default settings for PDF in Adobe Illustrator. |
Hey! Sorry to keep you in the dark for 8 whole days, just shot a quick eye at the text using a text diff viewer. Running a diff between the Data slice
Technically, this can be used to detect if this is, in the end, a PDF file. However, I don't know how many cans of worms this will also open up, as I'm not an active user of Adobe products. I can, however, attempt to implement a PR for this! |
Any chance to get this fixed? Cause the console version from "file-type" is getting the correct file-type (it's using npm file-type v12.xx i think). I'm using file-type as upload validator so my only two options are i am allowing AI file types too or waiting for a bugfix for this :) |
It's fixable but I have to mess around with it a lot cause of the way PDF files exist... Basically:
|
Ok, so for now i "just" also accept AI files and hope it will be fixed anytime :) However, will be cool to get this fixed :) |
We've also encountered this same regression. We rely on the PDF detection functionality to validate specific PDF processing requests but as of Is there a solution in mind here? I'd suggest it's more of a 'bug' than an 'enhancement' as it is falsely identifying one file type as another. For now, we've pinned to |
This appears to be back. I am currently using [email protected] and PDFs exported from illustrator with similar parameters to @fungiboletus and it is improperly detecting it as a .ai file. @vladfrangu |
Well the parsing was changed in #396 from what I did so I don't really know what the issue is. Best thing you can probably do is attach a file sample with the broken detection and someone will hopefully take a look |
@vladfrangu I can DM someone the file for testing, but would prefer to not share it in a public setting. Where should I send this? |
Could you replicate the pdf with non-sensitive information? (also helps since it can be added as a text fixture in the repo) |
Sure, let me generate something |
Since #323 (src: Add support for AI files (Adobe Illustrator)),
file-type
looks for the text "Adobe Illustrator
" in PDF documents and if it matches, it assumes it's an adobe.ai
file.It seems that normal PDF created with Adobe Illustrator will contain the text "
Adobe Illustrator
" quite a few times in the metadata too, even though they are not Adobe Illustrator files.The text was updated successfully, but these errors were encountered: