Welcome Guest, Not a member yet? Register   Sign In
Image_lib is quite inconvenient in its current state.
#1

[eluser]stevefink[/eluser]
Hi all,

First and foremost, I've had nothing short of a blast developing with Code Igniter, so please do not take this post in a derogatory way.

My current grief with the Image_lib library is that it does not give me a way to override the default naming schema for attached thumbnails through the API. Uploaded file foo.jpg will be named foo_thumb.jpg which makes it very inconvenient to locate without using any string type functions. (strpos, substr or regex)

As a temporary work around so I can continue working on this project, I edited Image_lib.php directly and changed the following:

old:

Code:
var $thumb_marker        = '_thumb';

new:

Code:
var $thumb_marker        = 'thumb_';

and the following:

old:

Code:
$this->full_dst_path = $this->dest_folder.$filename.$this->thumb_marker.$file_ext;
new:

Code:
$this->full_dst_path = $this->dest_folder.$this->thumb_marker.$filename.$file_ext;

I'm not an experienced developer by any means, so perhaps I'm overlooking something. Is there a reason it was created in the current fashion? By flipping those two switches around, I can now do something such as the following in my view:

Code:
<img src="&lt;?= base_url().thumb_$filename ?&gt;"

Thanks for taking a look at this.

- sf


Messages In This Thread
Image_lib is quite inconvenient in its current state. - by El Forum - 08-21-2007, 08:58 PM
Image_lib is quite inconvenient in its current state. - by El Forum - 08-21-2007, 09:30 PM
Image_lib is quite inconvenient in its current state. - by El Forum - 08-21-2007, 09:41 PM
Image_lib is quite inconvenient in its current state. - by El Forum - 08-21-2007, 10:04 PM
Image_lib is quite inconvenient in its current state. - by El Forum - 08-21-2007, 11:46 PM
Image_lib is quite inconvenient in its current state. - by El Forum - 08-22-2007, 01:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB