CodeIgniter :: how to resize and watermark image without saving it to hard disk [duplicate]
I'm having a problem: I want to resize and watermark an image in CodeIgniter. But I need "dynamic_output" to be TRUE.
$this->image_lib->resize();
$this->image_lib->watermark();
But when resize function fires it returns the image directly.
I don't need to save the image to save temporary copy. Any help?
Because $config['source_image'] must be set to a relative or absolut server path it is impossible to achieve what you are trying to do with the image library.
I would recommend not doing this with dynamic output, but if you really have to, should look around for a PHP script which can either resize or watermark an image dynamically based on image URLs and use that in conjunction with either the resize/watermark function from Codeigniter's library. Or simply use an entirely different library which supports this.
精彩评论