limits.c - manages data/functions for limiting the sizes of images read from files.
// user code if (!i_set_image_file_limits(max_width, max_height, max_bytes)) { // error } i_get_image_file_limits(&max_width, &max_height, &max_bytes); // file reader implementations if (!i_int_check_image_file_limits(width, height, channels, sizeof(i_sample_t))) { // error handling }
Manage limits for image files read by Imager.
Setting a value of zero means that limit will be ignored.
Set limits on the sizes of images read by Imager.
Setting a limit to 0 means that limit is ignored.
Negative limits result in failure.
Parameters:
i_img_dim width, height - maximum width and height.
size_t bytes - maximum size in memory in bytes. A value of zero sets this limit to one gigabyte.
Returns non-zero on success.
Also callable as i_set_image_file_limits(width, height, bytes).
i_set_image_file_limits(width, height, bytes)
Retrieves the file limits set by i_set_image_file_limits().
i_img_dim *width, *height - the maximum width and height of the image.
size_t *bytes - size in memory of the image in bytes.
Also callable as i_get_image_file_limits(&width, &height, &bytes).
i_get_image_file_limits(&width, &height, &bytes)
Checks the size of a file in memory against the configured image file limits.
This also range checks the values to those permitted by Imager and checks for overflows in calculating the size.
Returns non-zero if the file is within limits.
This function is intended to be called by image file read functions.
Also callable as i_int_check_image_file_limits(width, height, channels, sizeof(i_sample_t).
i_int_check_image_file_limits(width, height, channels, sizeof(i_sample_t)
1 POD Error
The following errors were encountered while parsing the POD:
=over without closing =back
To install Imager, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Imager
CPAN shell
perl -MCPAN -e shell install Imager
For more information on module installation, please visit the detailed CPAN module installation guide.