Skip to content

Support streams from imagick image editor#521

Closed
p00ya wants to merge 6 commits intoWordPress:masterfrom
p00ya:pull-50630
Closed

Support streams from imagick image editor#521
p00ya wants to merge 6 commits intoWordPress:masterfrom
p00ya:pull-50630

Conversation

@p00ya
Copy link
Copy Markdown

@p00ya p00ya commented Sep 7, 2020

Support streams from the imagick image editor. Fixes problems with using realpath and imagick::readImage with streams.

Trac ticket: https://core.trac.wordpress.org/ticket/42663


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@p00ya p00ya force-pushed the pull-50630 branch 3 times, most recently from f0d8ca1 to c950999 Compare October 4, 2020 14:30
p00ya added 6 commits October 17, 2020 12:05
Some streams do not support "stat()", but will still allow reading and
writing.
This separates the logic for writing to streams from "_save" into
_write_image.  It forces the call through "make_image" to match the
existing pattern.  "make_image" itself is overidden to unconditionally
invoke its callback.

In terms of compatibility, in the unlikely case that anyone is relying
on WP_Image_Editor_Imagick::make_image, it will work just the same for
plain files.  Stream support is new behaviour, so a caller will just
have to ensure their callback handles URLs appropriately.
Overriding make_image will likely make it incompatible with existing
callers.  Don't use it.
@dream-encode
Copy link
Copy Markdown
Contributor

Merged into WP Core in https://core.trac.wordpress.org/changeset/49230

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.

2 participants