This module aims to provide advanced properties on images that can be computed automatically. Properties are stored in a field which is composed of plugins defining individual properties and declaring a method to compute the value from an image or from other already computed properties (luminosity can be computed from average color, saved MEM and CPU). The source image is taken from any image field which can be configured on the field config form.
Initially the following properties are provided:
- Color tone (average color)
- Luminosity (average of average color RGB components)
The field values can be used by other modules or themes, for example a theme could use the luminosity property to control the color of a text overlay on top of an image (original motivation to create this module).
A field formatter does not exist yet, it might not be totally necessary to have one.
Currently it includes the option to show color widgets with jQuery MiniColors (included with composer) or the build-in 'color' field type. This was an experimental move, integration with https://www.drupal.org/project/jquery_minicolors would be better, probably.
I could not find any module which does this.
Instructions
- Add an "Image properties" field to an entity with at least one image field.
- On the field configuration form select the image field you wish to auto-generate the image properties for.
- Configure the field widget on the Manage form display page.
Project page (which also features a screenshot of the field widget)
https://www.drupal.org/sandbox/protostruct/2830338
Git clone command
git clone --branch 8.x-2.x https://git.drupal.org/sandbox/protostruct/2830338.git image_properties
Comments
Comment #2
protostruct commentedComment #3
protostruct commentedComment #4
protostruct commentedComment #5
PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6
protostruct commentedComment #7
jabastin arul commentedPlease review your code on "https://pareview.sh" site. We found some issue in your code. Here I have attached the link for your error code.
https://pareview.sh/node/161
Comment #8
jabastin arul commentedComment #9
protostruct commentedThank you!
I've done the coding style fixes.
The one remaining ERROR is wrong in my opinion, I can see throughout core that Annotation attributes use underscore convention. Or did they change the convention?
Comment #10
wim leersInteresting module :)
The one remaining error is indeed mistaken if it's for an annotation, annotation attributes must use underscores.
Comment #11
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxprotostruct2830338git
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #12
protostruct commentedYes, the bot does not know about the annotation error....
Comment #13
sajiniantony commentedHello,
In the file src/Plugin/Field/FieldWidget/ImagePropertiesDefaultWidget.php line no:120,t() calls should be avoided in classes, you can use $this->t() instead.
Comment #14
klausiThat is a good tip but on its own surely not an application blocker. Anything else that you found or should this be RTBC instead?
Comment #15
protostruct commentedThanks! Not only src/Plugin/Field/FieldWidget/ImagePropertiesDefaultWidget.php.
I changed to $this->t() where possible.
Comment #16
andor.koza commentedAutomated Review
https://pareview.sh/node/161 Found some errors and warnings, but as the others said those shouldn't be a problem.
Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.
Manual Review
Didn't find any issue by myself. On thing though is that when you install the minicolors library with composer the files are in the vendor folder and you manually need to copy them into the libraries folder to make it work properly. So you should describe this in the project description or change the libraries.yml file to use the minicolors library from the vendor folder.
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #17
protostruct commentedYes, I found that all libraries (composer type "drupal-library") go into vendor unless I specify the following in the composer.json:
That always solved it for me, but maybe not the proposed solution?
Thanks alot for your reviews!!
Comment #18
protostruct commentedIs there anything else I need to do to promote to full project? I can't find the option on the edit page...
Comment #19
poojasharmaece commentedHi protostruct,
Please follow https://www.drupal.org/node/2765201 to make sure its a Individual user account.
Comment #20
avpadernoThank you for your contribution!
I updated your account so you can opt into security advisory coverage now.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thank you, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks go the dedicated reviewer(s) as well.
Comment #21
avpaderno