X-Git-Url: http://git.imager.perl.org/imager.git/blobdiff_plain/5c65ffcebfa712c23c8d23b127e8985ed48e5268..e1c0692925:/limits.c diff --git a/limits.c b/limits.c index a245a6b2..e9f68bec 100644 --- a/limits.c +++ b/limits.c @@ -21,16 +21,20 @@ limits.c - manages data/functions for limiting the sizes of images read from fil Manage limits for image files read by Imager. Setting a value of zero means that limit will be ignored. - + +=over + +=cut */ #define IMAGER_NO_CONTEXT #include "imageri.h" /* -=item i_set_image_file_limits(width, height, bytes) - +=item im_set_image_file_limits(ctx, width, height, bytes) +XX =category Files +=synopsis im_set_image_file_limits(aIMCTX, 500, 500, 1000000); =synopsis i_set_image_file_limits(500, 500, 1000000); Set limits on the sizes of images read by Imager. @@ -56,6 +60,8 @@ this limit to one gigabyte. Returns non-zero on success. +Also callable as C. + =cut */ @@ -71,10 +77,6 @@ im_set_image_file_limits(pIMCTX, i_img_dim width, i_img_dim height, size_t bytes i_push_error(0, "height must be non-negative"); return 0; } - if (bytes < 0) { - i_push_error(0, "bytes must be non-negative"); - return 0; - } aIMCTX->max_width = width; aIMCTX->max_height = height; @@ -84,9 +86,10 @@ im_set_image_file_limits(pIMCTX, i_img_dim width, i_img_dim height, size_t bytes } /* -=item i_get_image_file_limits(&width, &height, &bytes) - +=item im_get_image_file_limits(ctx, &width, &height, &bytes) +XX =category Files +=synopsis im_get_image_file_limits(aIMCTX, &width, &height, &bytes) =synopsis i_get_image_file_limits(&width, &height, &bytes) Retrieves the file limits set by i_set_image_file_limits(). @@ -103,6 +106,8 @@ size_t *bytes - size in memory of the image in bytes. =back +Also callable as C. + =cut */ @@ -118,10 +123,11 @@ im_get_image_file_limits(pIMCTX, i_img_dim *width, i_img_dim *height, size_t *by } /* -=item i_int_check_image_file_limits(width, height, channels, sample_size) - +=item im_int_check_image_file_limits(width, height, channels, sample_size) +XX =category Files -=synopsis i_i_int_check_image_file_limits(width, height, channels, sizeof(i_sample_t)) +=synopsis im_int_check_image_file_limits(aIMCTX, width, height, channels, sizeof(i_sample_t)) +=synopsis i_int_check_image_file_limits(width, height, channels, sizeof(i_sample_t)) Checks the size of a file in memory against the configured image file limits. @@ -133,6 +139,8 @@ Returns non-zero if the file is within limits. This function is intended to be called by image file read functions. +Also callable as C. + =cut */