Presently, imdecode is all-or-nothing. If the user's data decodes correctly into some type of image, then the image is returned, and otherwise it isn't.
It would be really helpful if the user had more control over this process. For example, it would be handy if the user could decide if they want to abort the decode process after inspecting the type of image or its width/height. imdecode presently does not allow this.