Closed notflip closed 2 years ago
Well as it looks into every pixel I advise you not to use it with large images.
Could you put some sort of advisory warning on the docs to explain this? Maybe suggest it goes in a background job?
Is it certain file types, or will all files be slow?
:+1:
Would we get it to take a sample on large images?
Commit bf972826acc95cbb948f166110559c21bb3720d3 should improve speed.
First, I would like to thank you very much for this nice piece of code :) it's awesome Second, I've found that most images are procesed in about 1-3 seconds tops. BUT there are a few that takes more than 90 seconds -which is my PHP max_execution_time setting-, so it ends up on a fatal error. I don't really know what's the cause of this, so here's one of the images that causes such issue, in case you are interested in taking a look a it: https://unsplash.imgix.net/uploads/1412862685615b0212e3d/5fcb0a55?q=75&fm=jpg&s=e003fb9a4e39e3c07e4a94f7e0ef3db8
Cheers!
Thanks ^^
I've got no error trying to process the image, it took 3-5s even so it's pretty large. Are you sure you're using the latest version (0.1.7 now)? How many colors did you want to extract?
Thanks a lot for your reply :-) You were right, I've updated by running "composer update league/color-extractor:0.1.*" but got a "Nothing to install or update". After reading your response, I've run:
composer update leage/color-extractor:0.1.7
and that did it!
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing league/color-extractor (0.1.6)
- Installing league/color-extractor (0.1.7)
Downloading: connection... Downloading: 100%
Thanks again for this great library! Keep up the good work! ;-)
You're welcome! I think what you saw is related to #11
Hint: I bet performance might be improved if one create a thumbnail first.
Is it me or is the calculation happening very slow? Nice script by the way!