I wrote it like this: ob_start (); $ this-& amp; gt; ImageResizeNew (& #039; D: 123.jpg& #039;, 240,180 ); (This output image function is okay.) $ imagevariableob_get_contents (); ob_end_clean (); header (& #039; Content-type: imagejpeg & #039;); echo $ imagevar... I wrote it like this:
Ob_start ();
$ This-> ImageResizeNew ('d:/123.jpg ', 240,180); (this output image function is OK)
$ Imagevariable = ob_get_contents ();
Ob_end_clean ();
Header ('content-type: image/jpeg ');
Echo $ imagevariable;
I can display images normally in a non-CI framework, but I cannot display the code in the CI controller. I also asked questions in the CI official forum, but I didn't get a reply, I hope a friend who is familiar with the CI framework can help me solve this problem. I am very grateful.
This Code cannot be changed to the following one.
$ Pic_url = file_get_contents ('d:/123.jpg '); (there is no problem with the picture path)
Header ('content-type: image/jpeg ');
Echo $ pic_url;
Reply content:
I wrote it like this:
Ob_start ();
$ This-> ImageResizeNew ('d:/123.jpg ', 240,180); (this output image function is OK)
$ Imagevariable = ob_get_contents ();
Ob_end_clean ();
Header ('content-type: image/jpeg ');
Echo $ imagevariable;
I can display images normally in a non-CI framework, but I cannot display the code in the CI controller. I also asked questions in the CI official forum, but I didn't get a reply, I hope a friend who is familiar with the CI framework can help me solve this problem. I am very grateful.
This Code cannot be changed to the following one.
$ Pic_url = file_get_contents ('d:/123.jpg '); (there is no problem with the picture path)
Header ('content-type: image/jpeg ');
Echo $ pic_url;
Before using your image method, run the following ob_clean command to clear the ob cache, because the framework may have input content to the buffer before you use this method.