-
Notifications
You must be signed in to change notification settings - Fork 157
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
Palette.getMostUsedColors() getting different values depending on OS / PHP version #45
Comments
I witnessed a similar problem between GD and Imagick on the same environment. Sadly I have no idea if it's related or what is causing this. |
@MatTheCat Thanks for those additional informations, I also encounter diffrencies with the https://github.com/jenssegers/imagehash library. I'm not 100% sure but in my opinion JPEG files (and perhaps other kind of files) are not treated the same way depending on the OS / PHP / GD versions in use. For example this Stackoverflow post http://stackoverflow.com/questions/10647266/image-file-size-differences-between-imagemagick-and-gd-library indicates.
Perhaps this issue is also similar Intervention/image#355. Does anyone know if this supposition is correct or have much more informations about those differencies ? |
I don't think the problem comes from compression as I saw a difference between GD and Imagick with the exact same image. |
Handled the similar problem that Imagemagic and gd calculates different number of unique colors |
@MelnikDima how did you handle it? |
@MatTheCat something like $palette = Palette::fromFilename($file); |
Maybe the best course would be to just ignore these differences 🤔 |
Hi, I just started to use
color-extractor
in one or our customer's project.We wrote a unit test to check our code and it appears the
Palette.getMostUsedColors()
function is not returning de same results depending on the OS and/or PHP version in use (perhaps this could also be dependent on the GD version which is installed on the machine).For exemple on a Unix machine we get this array (the
limit
parameter is equal to12
and the index of this array has been converted to hexadecimal).On a Windows machine and with the same image we get the following values.
We only encounter this problem with one testing JPEG file (I can provide you the file if needed).
We also have similar unit test with GIF and PNG files, with those formats we do not encounter any problem.
So do you know what could cause differences in our case ?
If it can help here are much more details about each testing envirronment
If the problem is linked to GD perhaps doing the same test with #37 could be interesting.
In any case I the problem cannot be solved IMO it should be described and explained in the README.
Thanks
The text was updated successfully, but these errors were encountered: