Disable image autoscale when dimensions are bigger than my settings As you may know, in Drupal 7 you can set max and min dimensions for an image field, when you upload a small image, Drupal returns an error, but when you upload a bigger file it resize the image automatically instead of return the error "Your image is too big...".

I was looking for the reason of that autoscale configuration but looks like it will never be fixed. I need to override it because some of my users still uploading pictures with other dimentions, even with a different aspect ratio.

I found the condition in includes/file.inc line 1809 ... it tries to scale the image if it's bigger. I know that i can comment that condition and it will work, but is not a good idea, so:
Does anyone know how to override that condition using a custom module, hooks or something?
You don't want to return the message "your image is too big" as people nowadays are uploading directly from their mobile phones and do not have (or know) a way of resizing/cropping themselves before uploading.

So you should try it via another way: do not impose restrictions on the original image, but use an image style to display the uploaded images and add some smart/user/custom crop effect to that image style. There are a number of modules that let users/editors custom crop images, e.g:


Imagefield crop
Manual Crop
Smart Crop
...


Also see Comparison of image cropping and resizing modules.