… | |
… | |
257 | int x = 0, y = 0; |
257 | int x = 0, y = 0; |
258 | unsigned int w = 0, h = 0; |
258 | unsigned int w = 0, h = 0; |
259 | unsigned int n; |
259 | unsigned int n; |
260 | unsigned long new_flags = (flags & (~geometryFlags)); |
260 | unsigned long new_flags = (flags & (~geometryFlags)); |
261 | char *p; |
261 | char *p; |
262 | # define MAXLEN_GEOM 256 /* could be longer then regular geometry string */ |
262 | # define MAXLEN_GEOM 256 /* could be longer than regular geometry string */ |
263 | |
263 | |
264 | if (geom == NULL) |
264 | if (geom == NULL) |
265 | return false; |
265 | return false; |
266 | |
266 | |
267 | char str[MAXLEN_GEOM]; |
267 | char str[MAXLEN_GEOM]; |
… | |
… | |
274 | if (n < MAXLEN_GEOM) |
274 | if (n < MAXLEN_GEOM) |
275 | { |
275 | { |
276 | char *ops; |
276 | char *ops; |
277 | new_flags |= geometrySet; |
277 | new_flags |= geometrySet; |
278 | |
278 | |
279 | strncpy (str, geom, n); |
279 | memcpy (str, geom, n); |
280 | str[n] = '\0'; |
280 | str[n] = '\0'; |
281 | if (str[0] == ':') |
281 | if (str[0] == ':') |
282 | ops = &str[0]; |
282 | ops = &str[0]; |
283 | else if (str[0] != 'x' && str[0] != 'X' && isalpha(str[0])) |
283 | else if (str[0] != 'x' && str[0] != 'X' && isalpha(str[0])) |
284 | ops = &str[0]; |
284 | ops = &str[0]; |
… | |
… | |
512 | 100, ASIMAGE_QUALITY_DEFAULT); |
512 | 100, ASIMAGE_QUALITY_DEFAULT); |
513 | } |
513 | } |
514 | if (background == NULL) |
514 | if (background == NULL) |
515 | { |
515 | { |
516 | /* if tiling - pixmap has to be sized exactly as the image, |
516 | /* if tiling - pixmap has to be sized exactly as the image, |
517 | but there is no need to make it bigger then the window! */ |
517 | but there is no need to make it bigger than the window! */ |
518 | if (h_scale == 0) |
518 | if (h_scale == 0) |
519 | new_pmap_width = min (result->width, target_width); |
519 | new_pmap_width = min (result->width, target_width); |
520 | if (v_scale == 0) |
520 | if (v_scale == 0) |
521 | new_pmap_height = min (result->height, target_height); |
521 | new_pmap_height = min (result->height, target_height); |
522 | /* we also need to tile our image in one or both directions */ |
522 | /* we also need to tile our image in one or both directions */ |
… | |
… | |
668 | original_asim = get_asimage (target->asimman, file, 0xFFFFFFFF, 100); |
668 | original_asim = get_asimage (target->asimman, file, 0xFFFFFFFF, 100); |
669 | else |
669 | else |
670 | { |
670 | { |
671 | size_t len = f - file; |
671 | size_t len = f - file; |
672 | f = (char *)malloc (len + 1); |
672 | f = (char *)malloc (len + 1); |
673 | strncpy (f, file, len); |
673 | memcpy (f, file, len); |
674 | f[len] = '\0'; |
674 | f[len] = '\0'; |
675 | original_asim = get_asimage (target->asimman, f, 0xFFFFFFFF, 100); |
675 | original_asim = get_asimage (target->asimman, f, 0xFFFFFFFF, 100); |
676 | free (f); |
676 | free (f); |
677 | } |
677 | } |
678 | return (original_asim != NULL); |
678 | return (original_asim != NULL); |