{"id":6901997,"date":"2016-01-03T17:23:48","date_gmt":"2016-01-03T17:23:48","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/getting-a-gd-image-from-wp_image_editor\/"},"modified":"2016-08-30T23:59:43","modified_gmt":"2016-08-30T23:59:43","slug":"getting-a-gd-image-from-wp_image_editor","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/getting-a-gd-image-from-wp_image_editor\/","title":{"rendered":"Getting a GD image from WP_Image_Editor"},"content":{"rendered":"<p>Hey there.  I&#8217;m trying to do some image manipulation for a custom plugin, and some of it requires a bit more than the WP_Image_Editor really provides (Like making new images), and part of my requirements is to manipulate a WP_Image_Editor image in GD, and I&#8217;d rather not deal with files.<\/p>\n<p>I tried using the WP_Image_Editor::stream function, but it seems to always return 1 when I put that output into the error_log.<\/p>\n<p>My code is here:<\/p>\n<pre><code>function wpToGD($image_wp){\n    error_log(print_r($image_wp-&gt;stream()));\n    return imagecreatefromstring($image_wp-&gt;stream());\n}<\/code><\/pre>\n<p>Is there something I&#8217;m missing here?  Thanks.<\/p>\n","protected":false},"template":"","class_list":["post-6901997","topic","type-topic","status-publish","hentry","topic-tag-gd","topic-tag-image-manipulation","topic-tag-wp_image_editor"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6901997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6901997\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6901997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}