public function generateIdentifier( $id, $attributes = null )
    {
        $filename = (string) $id;
        $illegalFileNameChars = array(
            ' '  => '_',
            '/'  => DIRECTORY_SEPARATOR,
            '\\' => DIRECTORY_SEPARATOR,
        );
        $filename = strtr( $filename, $illegalFileNameChars );

        // Chars used for filename concatination
        $illegalChars = array(
            '-' => '#',
            ' ' => '%',
            '=' => '+',
            '.' => '+',
        );
        if ( is_array( $attributes ) && count( $attributes ) > 0 )
        {
            ksort( $attributes );
            foreach ( $attributes as $key => $val )
            {
                $attrStr = '-' . strtr( $key, $illegalChars )
                         . '=' . strtr( $val, $illegalChars );
                if ( strlen( $filename . $attrStr ) > 250 )
                {
                    // Max filename length
                    break;
                }
                $filename .= $attrStr;
            }
        }
        else
        {
            $filename .= '-';
        }
        return $filename . $this->properties['options']['extension'];
    }