]> git.imager.perl.org - imager.git/blobdiff - limits.c
- reword and provide an example for non-proportionally scaling an
[imager.git] / limits.c
index 01e890220d236eb2f3e68df8c59ec6db5432e077..de02ddd2eb9277e6ef12af265de6fd6fb73a20cb 100644 (file)
--- a/limits.c
+++ b/limits.c
@@ -24,7 +24,7 @@ Setting a value of zero means that limit will be ignored.
   
  */
 
-#include "imagei.h"
+#include "imageri.h"
 
 static int max_width, max_height;
 static int max_bytes;
@@ -66,6 +66,7 @@ i_get_image_file_limits(int *width, int *height, int *bytes) {
 
 int
 i_int_check_image_file_limits(int width, int height, int channels, int sample_size) {
+  int bytes;
   i_clear_error();
   
   if (width <= 0) {
@@ -107,7 +108,7 @@ i_int_check_image_file_limits(int width, int height, int channels, int sample_si
      We don't protect it under max_bytes since we always want to check 
      for overflow.
   */
-  int bytes = width * height * channels * sample_size;
+  bytes = width * height * channels * sample_size;
   if (bytes / width != height * channels * sample_size
       || bytes / height != width * channels * sample_size) {
     i_push_error(0, "file size limit - integer overflow calculating storage");