Welcome Guest, Not a member yet? Register   Sign In
image_lib improvement: keep resource for several actions (better quality)
#1

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

Attached Files
.php   Image_lib.php (Size: 44.52 KB / Downloads: 51)
Reply
#2

You should never modify a CodeIgniter System file!

You extend the libraries and add what's needed.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB