2 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
3 * Copyright (C) 2005 Atsushi Konno 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.
22 request_rec* r, device_table* spec, const char* s)
26 dst = apr_pstrdup(r->pool, s);
29 switch (spec->color) {
30 case 2 : dst = apr_pstrcat(r->pool, dst,".10", NULL); break;
31 case 4 : dst = apr_pstrcat(r->pool, dst,".20", NULL); break;
32 case 256 : dst = apr_pstrcat(r->pool, dst,".30", NULL); break;
33 case 4096 : dst = apr_pstrcat(r->pool, dst,".40", NULL); break;
34 case 65536 : dst = apr_pstrcat(r->pool, dst,".50", NULL); break;
35 case 262144 : dst = apr_pstrcat(r->pool, dst,".60", NULL); break;
36 case 15680000: dst = apr_pstrcat(r->pool, dst,".70", NULL); break;
37 default: dst = apr_pstrcat(r->pool, dst,".30", NULL); break;
40 if (spec->available_jpeg != 0)
41 return apr_pstrcat(r->pool, dst,".jpg", NULL);
43 if (spec->available_png != 0)
44 return apr_pstrcat(r->pool, dst,".png", NULL);
46 if (spec->available_gif != 0)
47 return apr_pstrcat(r->pool, dst, ".gif", NULL);
49 if (spec->available_bmp4 != 0 || spec->available_bmp2 != 0)
50 return apr_pstrcat(r->pool, dst, ".bmp", NULL);