CodeIgniter Forums

Full Version: image_lib improvement: keep resource for several actions (better quality)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. (Spanish native speaker; sorry about my english)

I've been involved in a project where i should put many words on a background image. Also, sometimes it has to be saved to a file on server and someother it was created on the fly and returned (no saving on server).

So i had to make a modification on image_lib library to keep the resource between different text_watermark method invokes; added a property option for the flag and a private property for the image resource. Also a method to get that resource. And finally modified the text_whatermark method so it could take -at the beggining- the resource if flag and resource were set, and returning true without destroying it before leaving.

That make me achive two goals:
-improve result image quality
-being able no to save unnecesary files

Maybe this kind of improvement can be applied for the others methods (overlay_watermark, crop, resize...).

Hope it could be considered for future versions.

Omar
You should never modify a CodeIgniter System file!

You extend the libraries and add what's needed.
(11-23-2018, 04:52 AM)InsiteFX Wrote: [ -> ]You should never modify a CodeIgniter System file!

You extend the libraries and add what's needed.

Yes... i should never do it... but i was in a rush, and also i'm suggesting an -intresting?- improvment on the library, for implementing many watermarks keeping image resource instead of saving each time (and loosing quality).

Cheers