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 new "MEDIA_RESIZE" event #3046

Merged
merged 1 commit into from Jun 30, 2020
Merged

Conversation

takuy
Copy link
Contributor

@takuy takuy commented Apr 12, 2020

Not sure if this is the best approach but would close #3032.

This adds a single "MEDIA_RESIZE" event called in fetch.php for when an image is requested by a client.

Copy link
Collaborator

@phy25 phy25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM but I am not sure if we want an event for this.

@takuy
Copy link
Contributor Author

takuy commented Apr 12, 2020

Generally LGTM but I am not sure if we want an event for this.

There's a few things I personally would want to change/add configuration options for in terms of how things are resized (or skip it entirely depending on context) that would be doable as plugins if this event is added:

  • disable server-side resizing for a specific file extension (which I also have written here, not sure if I want to submit that as a separate PR yet (takuy@dfa769b)
  • disable server-side resizing for internal images if it has nocache set
  • write a completely different resize algorithm using another tool (ie, not use GD or ImageMagick)
  • resize specific file types using different methods (ie, not use GD or ImageMagick)

@splitbrain splitbrain merged commit 0c5897c into dokuwiki:master Jun 30, 2020
@splitbrain
Copy link
Collaborator

@takuy can you add the necessary documentation in the wiki please?

@takuy
Copy link
Contributor Author

takuy commented Jul 6, 2020

@takuy can you add the necessary documentation in the wiki please?

Thanks @splitbrain, I've created devel:event:media_resize for this event. Let me know if there's any additional document required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Event Handler for image events (resizing / cropping)
3 participants