Crop entity allows you to crop images you use on other entities. So does a lot of other modules.

The difference is that Crop entity produces a 'shadow' entity for every time you crop an image on an entity. This allows you to reuse an image on several articles, but use a different crop every time. Along with the crop entity a relation between crop, original image and the crop URI is saved in a table created by the module. This allows most lookups to happen without loading the full crop node for better performance.

The module was built for a site with a high volume article production focusing on one crop per image per referencing entity. The crop entity replaces the image URI when the node is rendered and can thereby be subject to image styles and all other processing.

Project sandbox page:
https://www.drupal.org/sandbox/kristougher/2423063

Comments

PA robot’s picture

Status: Active » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxkristougher2423063git

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.

kristougher’s picture

Fixed the issues from the PA robot.

kristougher’s picture

Status: Needs work » Active
tss’s picture

Status: Active » Needs review

From the checklist:

1. Basic application checks
1.1 OK
1.2 OK
- There is a similar project, but this projects README explains the difference.)

2. Basic repository checks
2.1 OK

3. Security Review
3.1 Not checked.

4. Licensing checks
4.1 OK
4.2 OK

5. Documentation checks
5.1 Ensure the project page contains detailed information.
- Missing (?)
5.2 Ensure the repository contains a detailed README.txt.
- Readme file has .md extension, but that is ok according to https://www.drupal.org/node/161085.
- The text is not an exact copy. This needs to be re-reviewed to see if the information is basically the same.
5.3 OK

6. Coding standards and style
6.1 Not checked.

7. API and best practices Review
7.1 Not checked.

tss’s picture

6. Coding standards and style
6.1 OK

- Only 1 warning (Using phpcs with the Drupal standard from the Coder module):

FILE: crop_entity/src/CropEntity.php
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 387 | WARNING | The use of private methods or properties is strongly
     |         | discouraged, use "protected" instead
--------------------------------------------------------------------------------
darol100’s picture

  • Here are some minor warnings from coder module:
    Line 177: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
    
        $uri = $scheme . '://images/crop/' . $date . $time . '_' .   $filename;
    
    Line 364: Potential problem: drupal_set_message() only accepts filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized. (Drupal Docs)
    
            drupal_set_message('The file could not be saved. Error message: @error', array('@error' => $error));
    
    Line 364: The $message argument to drupal_set_message() should be enclosed within t() so that it is translatable.
    
            drupal_set_message('The file could not be saved. Error message: @error', array('@error' => $error));
    
    Line 368: The $message argument to drupal_set_message() should be enclosed within t() so that it is translatable.
    
          drupal_set_message('The crop was not generated. This can be a write permission problem, a timeout or any other reason. Ask your server administrator if the problem persists.');
  • You should provide the hook_help to allow site builders to find information about your module.
  • README.md there is a typo -
    Line 45: The xautoload is not strictly necessary for the functionalitu, but I kind of
    

    I believe you mean "functionality" instead of functionalitu.

  • Personal recommendation is to use the README.txt template to created your README.md. It just because a huge paragraph can be kinda confusing. Formarting your README.md with sections would make easier to read it.
  • I do not think you should keep your "TODO" inside of your README.txt. Remove the TODO from the README.md
  • Pareview.sh - Show two warning and one error http://pareview.sh/pareview/httpgitdrupalorgsandboxkristougher2423063git
  • Can I add a ration using Drupal UI ?

darol100’s picture

Status: Needs review » Needs work
kristougher’s picture

Thank you for the comments.

I have fixed the code style issues, improved the Readme and added a hook_help implementation - maybe not the most extensive explanations, but I hope they will help the user get on track.

For now you cannot add a ratio in the UI, but it is a very good suggestion and I have created an issue for that: https://www.drupal.org/node/2494437

kristougher’s picture

Status: Needs work » Needs review
darol100’s picture

Status: Needs review » Reviewed & tested by the community

@kristougher, Well done.

I review this project and I do not see any blockers.

kristougher’s picture

@darol100 Thanks a lot for helpful comments and approval :)

cweagans’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

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!

Thanks, 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 to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.