forked from old/legacy-imlib2
Miscellaneous fixes I ran across while doing the colormod stuff. One of
which fixes a seg fault bug. SVN revision: 3243
This commit is contained in:
parent
b99cd06c87
commit
f16c92658f
|
@ -150,7 +150,7 @@ AC_SUBST(x_libs)
|
|||
AC_SUBST(dlopen_libs)
|
||||
|
||||
AC_OUTPUT(imlib2-config Makefile loaders/Makefile src/Makefile test/Makefile \
|
||||
filters/Makefile demo/Makefile dox/Makefile imlib2.spec,
|
||||
filters/Makefile demo/Makefile imlib2.spec,
|
||||
[
|
||||
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h;
|
||||
chmod +x imlib2-config
|
||||
|
|
|
@ -131,6 +131,8 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
png_set_packing(png_ptr);
|
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
|
||||
png_set_expand(png_ptr);
|
||||
if (im->data)
|
||||
free(im->data);
|
||||
im->data = malloc(w * h * sizeof(DATA32));
|
||||
if (!im->data)
|
||||
{
|
||||
|
|
|
@ -148,7 +148,7 @@ DATA32 *imlib_image_get_data(void);
|
|||
DATA32 *imlib_image_get_data_for_reading_only(void);
|
||||
void imlib_image_put_back_data(DATA32 *data);
|
||||
char imlib_image_has_alpha(void);
|
||||
void imlib_image_set_never_changes_on_disk(Imlib_Image image);
|
||||
void imlib_image_set_never_changes_on_disk(void);
|
||||
void imlib_image_get_border(Imlib_Border *border);
|
||||
void imlib_image_set_border(Imlib_Border *border);
|
||||
void imlib_image_set_format(const char *format);
|
||||
|
@ -214,8 +214,8 @@ void imlib_set_font_cache_size(int bytes);
|
|||
void imlib_flush_font_cache(void);
|
||||
int imlib_get_font_ascent(void);
|
||||
int imlib_get_font_descent(void);
|
||||
int imlib_get_maximum_font_ascent(Imlib_Font font);
|
||||
int imlib_get_maximum_font_descent(Imlib_Font font);
|
||||
int imlib_get_maximum_font_ascent(void);
|
||||
int imlib_get_maximum_font_descent(void);
|
||||
|
||||
Imlib_Color_Modifier imlib_create_color_modifier(void);
|
||||
void imlib_free_color_modifier(void);
|
||||
|
|
17
src/api.c
17
src/api.c
|
@ -583,7 +583,7 @@ imlib_image_has_alpha(void)
|
|||
}
|
||||
|
||||
void
|
||||
imlib_image_set_never_changes_on_disk(Imlib_Image image)
|
||||
imlib_image_set_never_changes_on_disk(void)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
||||
|
@ -1792,7 +1792,6 @@ imlib_text_get_location_at_index(const char *text, int index,
|
|||
return;
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
char **
|
||||
|
@ -1843,14 +1842,14 @@ imlib_get_font_descent(void)
|
|||
}
|
||||
|
||||
int
|
||||
imlib_get_maximum_font_ascent(Imlib_Font font)
|
||||
imlib_get_maximum_font_ascent(void)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("imlib_get_maximum_font_ascent", "font", ctxt_font , 0);
|
||||
return ((ImlibFont *)ctxt_font)->max_ascent;
|
||||
}
|
||||
|
||||
int
|
||||
imlib_get_maximum_font_descent(Imlib_Font font)
|
||||
imlib_get_maximum_font_descent(void)
|
||||
{
|
||||
CHECK_PARAM_POINTER_RETURN("imlib_get_maximum_font_descent", "font", ctxt_font , 0);
|
||||
return ((ImlibFont *)ctxt_font)->max_ascent;
|
||||
|
@ -2581,18 +2580,16 @@ imlib_filter_divisors(int a, int r, int g, int b)
|
|||
__imlib_FilterDivisors((ImlibFilter *)ctxt_filter, a, r, g, b);
|
||||
}
|
||||
|
||||
void imlib_apply_filter( char *script, ... )
|
||||
void imlib_apply_filter(char *script, ...)
|
||||
{
|
||||
IFunction *func = NULL, *ptr;
|
||||
va_list param_list;
|
||||
Imlib_Image im;
|
||||
|
||||
|
||||
__imlib_dynamic_filters_init();
|
||||
CAST_IMAGE(im, ctxt_image);
|
||||
__imlib_DirtyImage(im);
|
||||
__imlib_DirtyPixmapsForImage(im);
|
||||
va_start( param_list, script );
|
||||
__imlib_script_parse( im, script, param_list );
|
||||
va_end( param_list );
|
||||
va_start(param_list, script);
|
||||
__imlib_script_parse(im, script, param_list);
|
||||
va_end(param_list);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ __imlib_DataCmodApply(DATA32 *data, int w, int h, int jump,
|
|||
DATA8 r, g, b, a;
|
||||
|
||||
/*\ We might be adding alpha \*/
|
||||
if (!(*fl & F_HAS_ALPHA))
|
||||
if (fl && !(*fl & F_HAS_ALPHA))
|
||||
{
|
||||
p = data;
|
||||
for (y = 0; y < h; y++)
|
||||
|
|
Loading…
Reference in New Issue