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)
+X<im_set_image_file_limits API>X<i_set_image_file_limits API>
=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.
Returns non-zero on success.
+Also callable as C<i_set_image_file_limits(width, height, bytes)>.
+
=cut
*/
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;
}
/*
-=item i_get_image_file_limits(&width, &height, &bytes)
-
+=item im_get_image_file_limits(ctx, &width, &height, &bytes)
+X<im_get_image_file_limits API>X<i_get_image_file_limits>
=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().
=back
+Also callable as C<i_get_image_file_limits(&width, &height, &bytes)>.
+
=cut
*/
}
/*
-=item i_int_check_image_file_limits(width, height, channels, sample_size)
-
+=item im_int_check_image_file_limits(width, height, channels, sample_size)
+X<im_int_check_image_file_limits API>X<i_int_check_image_file_limits>
=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.
This function is intended to be called by image file read functions.
+Also callable as C<i_int_check_image_file_limits(width, height, channels, sizeof(i_sample_t)>.
+
=cut
*/