$config['file_name'] = preg_replace('/(\.gif|\.jpg|\.png)/', '_thumb$1', $filename);
Basically I want filename.jpg
to become filename_thumb.jpg
I don't understand why but the extension is being repeated twice. (filename.jpg.jpg).
Edit This does work, I have other problems in my code.