Skip to content
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

return true for some RGB images #1

Open
QuentinGprd opened this issue Sep 23, 2019 · 2 comments
Open

return true for some RGB images #1

QuentinGprd opened this issue Sep 23, 2019 · 2 comments

Comments

@QuentinGprd
Copy link

Hello,

First of all, thanks for the module, it is working in some cases.

However, I have a false positive with a lot of images, it returns true at the following conditional:

    // CMYK
    if (data.includes('CMYK')) {
        return true;
    }

I have no idea how finding 'CMYK' in the Buffer works so any help would be greatly appreciated. Maybe there is a way to make it more restrictive?

You can find an RGB image that returns true here (zipped to prevent any image conversion on upload):
omer.jpg.zip

Thanks for your help.

@zengming00
Copy link
Owner

Thank you for your report. As you can see, this module has not been maintained for two years. I have not done any related work, so I may not be able to give you much help. I simply deleted the lines of code and then released Version 1.0.2, It should work fine.
Direct search for the 'CMYK' string may be a simple way to determine if a picture is CMYK. Unfortunately, this doesn't work. I haven't found this problem because I will convert CMYK images to RGB using tools like ffmpeg, so there is This issue has not been affected as a result.

@QuentinGprd
Copy link
Author

Yep, I have also deleted this part and after some tests, cmyk files are returning true later in the code anyway.

I will probably end doing the conversion automatically for the user too, when I have more time.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants