A possible solution to that is to base64 encode the arguments and convert / to something more filesystem friendly (-?), then you can use a straight explode('#', $filename) to parse everything out.

On 17/04/2013, at 8:35 PM, Ingo Schommer <notifications@github.com> wrote:

> In model/Image.php:
> 
> > @@ -533,13 +538,28 @@ public function generateCroppedImage(Image_Backend $backend, $width, $height) {
> >  		return $backend->croppedResize($width, $height);
> >  	}
> >  	
> > +	private function getFilenamePatterns($filename) {
> > +		$methodNames = $this->allMethodNames(true);
> > +		$generateFuncs = array();
> > +		foreach($methodNames as $methodName) {
> > +			if(substr($methodName, 0, 8) == 'generate') {
> > +				$format = substr($methodName, 8);
> > +				$generateFuncs[] = preg_quote($format);
> > +			}
> > +		}
> > +		// All generate functions may appear any number of times in the image cache name.
> > +		$generateFuncs = implode('|', $generateFuncs);		
> > +		return array(
> > +				'FullPattern' => "/^((?P<Generator>{$generateFuncs})(?P<Args>(([0-9a-fA-F]*(x?))*))\-)+" . preg_quote($filename) . "$/i",
> 
> Damn, was looking at 3.1 to validate my thinking, forgot that you had added that API in master. OK, escaping chars it is then. My suggestion would be #, since thats causing less problems on filesystems than anything around slashes. Free form text as an arg will be difficult anyway because of encoding, but its at least not as narrow and arbitrary as "only hexadecimal".
> 
> —
> Reply to this email directly or view it on GitHub.
> 

---
Simon Welsh
Admin of http://simon.geek.nz/