Skip to content
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

Add hook for img.php before using CImage #123

Closed
mosbth opened this issue Oct 20, 2015 · 0 comments
Closed

Add hook for img.php before using CImage #123

mosbth opened this issue Oct 20, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@mosbth
Copy link
Owner

mosbth commented Oct 20, 2015

Added a hook where one can create an own function to do calculations and change the settings, before CImage is called.

      /**
       * A function (hook) can be called after img.php has processed all
       * configuration options and before processing the image using CImage.
       * The function receives the $img variabel and an array with the
       * majority of current settings.
       *
       * Default value:
       *  hook_before_CImage:     null
       */
       /*'hook_before_CImage' => function (CImage $img, Array $allConfig) {
           if ($allConfig['newWidth'] > 10) {
               $allConfig['newWidth'] *= 2;
           }
           return $allConfig;
       },*/

This can be used to implement #118 or equal logic that could be debatable if it should be in img.php/CImage or not.

@mosbth mosbth closed this as completed Oct 20, 2015
@mosbth mosbth added this to the v0.7.7 milestone Oct 20, 2015
@mosbth mosbth self-assigned this Oct 20, 2015
@mosbth mosbth added the feature label Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant