Code Monkey home page Code Monkey logo

piwigo-color-palette's Introduction

Hi there, I'm aNNiMON!

I love ๐Ÿ’ป programming, :octocat: open source, ๐ŸŽง music, ๐ŸŽจ art, ๐Ÿƒ running, ๐Ÿค” learning and ๐Ÿ—ฃ๏ธ sharing knowledge.

I'm the founder of annimon.com โ€” a 10+ years old site where you can share your programming knowledge and learn something new.

Some tutorials you can find in annimon-tutorials organization.

More information about my projects and publications you can find on projects.annimon.com.

piwigo-color-palette's People

Contributors

annimon avatar audioscavenger avatar fly-man- avatar piwigo-translationteam avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

audioscavenger

piwigo-color-palette's Issues

Color Palette does not appear on Piwigo 11.1.0

Hello there. I noticed that Color Palette does not appear on photo details page on Piwigo version 11.1.0 as it should. On version 11, it worked perfectly.

The extension is flagged as compatible in version 11 and now 11.1.0.

SQL - missing indexes for look up

I've index my 35000 photos with color palette, and when I try a look up, I have a timeout.

The request looks like:

ANALYZE
SELECT
    1 as i,
    pal.image_id as pal_image_id
FROM
    piwigo_color_palette pal
    INNER JOIN piwigo_images img ON img.id = pal.image_id
    INNER JOIN piwigo_image_category cat ON img.id = cat.image_id
WHERE
    (
        (
            color_r BETWEEN 204
            AND 204
        )
        AND (
            color_g BETWEEN 0
            AND 0
        )
        AND (
            color_b BETWEEN 0
            AND 0
        )
    )
    AND cat.category_id NOT IN (0)
    AND img.level <= 8
GROUP BY
    pal.image_id
HAVING
    SUM(i) = 1;

The analyze give:

+------+-------------+-------+--------+---------------------------+-------------------+---------+---------------------+-------+----------+----------+------------+-----------------------------------------------------------+
| id   | select_type | table | type   | possible_keys             | key               | key_len | ref                 | rows  | r_rows   | filtered | r_filtered | Extra                                                     |
+------+-------------+-------+--------+---------------------------+-------------------+---------+---------------------+-------+----------+----------+------------+-----------------------------------------------------------+
|    1 | SIMPLE      | cat   | range  | PRIMARY,image_category_i1 | image_category_i1 | 2       | NULL                | 16692 | 33926.00 |   100.00 |     100.00 | Using where; Using index; Using temporary; Using filesort |
|    1 | SIMPLE      | img   | eq_ref | PRIMARY                   | PRIMARY           | 3       | piwigo.cat.image_id | 1     | 1.00     |   100.00 |     100.00 | Using where                                               |
|    1 | SIMPLE      | pal   | ref    | image_id                  | image_id          | 4       | piwigo.cat.image_id | 12    | 8.00     |   100.00 |       0.11 | Using index condition; Using where                        |
+------+-------------+-------+--------+---------------------------+-------------------+---------+---------------------+-------+----------+----------+------------+-----------------------------------------------------------+
3 rows in set (1 min 20.215 sec)

It took 1min20 to filter!

I create this index:

create index pwg_cp_ccci on piwigo_color_palette (color_r, color_g, color_b, image_id);

Then the analyze give:

+------+-------------+-------+--------+---------------------------+-------------+---------+---------------------+------+--------+----------+------------+--------------------------+
| id   | select_type | table | type   | possible_keys             | key         | key_len | ref                 | rows | r_rows | filtered | r_filtered | Extra                    |
+------+-------------+-------+--------+---------------------------+-------------+---------+---------------------+------+--------+----------+------------+--------------------------+
|    1 | SIMPLE      | pal   | ref    | image_id,pwg_cp_ccci      | pwg_cp_ccci | 3       | const,const,const   | 191  | 308.00 |   100.00 |     100.00 | Using where; Using index |
|    1 | SIMPLE      | cat   | ref    | PRIMARY,image_category_i1 | PRIMARY     | 3       | piwigo.pal.image_id | 1    | 1.00   |    50.00 |     100.00 | Using where; Using index |
|    1 | SIMPLE      | img   | eq_ref | PRIMARY                   | PRIMARY     | 3       | piwigo.pal.image_id | 1    | 1.00   |   100.00 |     100.00 | Using where              |
+------+-------------+-------+--------+---------------------------+-------------+---------+---------------------+------+--------+----------+------------+--------------------------+
3 rows in set (0.007 sec)

The look up takes 0.007 sec now !

Can you integrate this index with a migration or something?

Thanks.

Ability to select multiple colors

Would it be possible to have multiple selections, for example 3 colors, to match an image ?

One sample helps but with over 10.000 images I'd like to be able to distinct even more then with just 1 color.

new features

hi, awesome little plugin, love it, exactly what should be the default in any serious picture managers!

now, i see you are still active on it so can i ask for features and send pull requests?

  1. ability to show the PALETTE_WEIGHTS in admin menu as a grid, so we can see it, re-weight it and decrease its size with a slider. Too many colors, results in many shades of the same color and does not help in searching.
  2. add an info somewhere on how colors are related to each other when we search? how far do you go, is it the next 1, 2 or 3 closest colors? is it by luminance or rgb?
  3. how can we improve the colors weighting? i can never find the obvious, eye catching colors in the pictures using less then 8 color palettes. ideally i would like 4 colors per picture, it's sufficient, but all i get is shades of dark.

Security bug?

Hi!
I encountered pretty serious bug with this plugin I think.
The palette search shows pictures from private albums, even for guests! When I click them, I got access denied, but the thumbs are visible!
I found it out by coincidence when I found images from private albums on Google image search - so it was evident they were exposed for guest access!
Please check the code, because without a fix it's impossible to use it for me.
Thanks.
Tom

Ability to pick location of sample

If possible, I would like to be able to select the location inside the picture where it takes the sample.

Especially with large images, it takes a sample of the colors that are all the same

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.