2 * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
26 char *dst = apr_pstrdup(r->pool, s);
28 switch (spec->color) {
29 case 2 : dst = apr_pstrcat(r->pool, dst,".10", NULL); break;
30 case 4 : dst = apr_pstrcat(r->pool, dst,".20", NULL); break;
31 case 256 : dst = apr_pstrcat(r->pool, dst,".30", NULL); break;
32 case 4096 : dst = apr_pstrcat(r->pool, dst,".40", NULL); break;
33 case 65536 : dst = apr_pstrcat(r->pool, dst,".50", NULL); break;
34 case 262144 : dst = apr_pstrcat(r->pool, dst,".60", NULL); break;
35 case 15680000: dst = apr_pstrcat(r->pool, dst,".70", NULL); break;
36 default: dst = apr_pstrcat(r->pool, dst,".30", NULL); break;
39 if (spec->available_jpeg)
40 return apr_pstrcat(r->pool, dst,".jpg", NULL);
42 if (spec->available_png)
43 return apr_pstrcat(r->pool, dst,".png", NULL);
45 if (spec->available_gif)
46 return apr_pstrcat(r->pool, dst, ".gif", NULL);
48 if (spec->available_bmp4 || spec->available_bmp2)
49 return apr_pstrcat(r->pool, dst, ".bmp", NULL);