};
/*
-=item i_img_pal_new(C<x>, C<y>, C<channels>, C<maxpal>)
-
+=item im_img_pal_new(ctx, C<x>, C<y>, C<channels>, C<maxpal>)
+X<im_img_pal_new API>X<i_img_pal_new API>
=category Image creation/destruction
+=synopsis i_img *img = im_img_pal_new(aIMCTX, width, height, channels, max_palette_size)
=synopsis i_img *img = i_img_pal_new(width, height, channels, max_palette_size)
Creates a new paletted image of the supplied dimensions.
Returns a new image or NULL on failure.
+Also callable as C<i_img_pal_new(width, height, channels, max_palette_size)>.
+
=cut
*/
i_img *
i_img_rgb_convert(&temp, im);
/* nasty hack */
- (im->i_f_destroy)(im);
- myfree(im->idata);
+ i_img_exorcise(im);
*im = temp;
+ /* i_img_empty_ch() calls i_img_init() which takes a ref */
+ im_context_refdec(aIMCTX, "img_destroy");
+
return 1;
}