I spent few hours just figuring why the image I wanted to display was displayed as a link (I know it's stupid). I think it would be very nice to have an error message mentionning that the image is "out of bound". It should take place in the very last function of inline.module (I'm no good at php):

/**
* Decides if a tag (<img>) or a link to a file should be rendered
* @param $file a file object
* @return TRUE in case an img tag should be generated
*/
function _inline_decide_img_tag($file) {
$inlined = array('jpg', 'jpeg', 'pjpeg', 'gif', 'png');
$mime = array_pop(explode('/', $file->filemime));
if (in_array($mime, $inlined)) {
// read settings
list($maxwidth, $maxheight) = explode(',',variable_get('inline_img_dim', '150,150'));

if ($file->preview) {
list($width, $height) = getimagesize($file->real_path);
}
else {
list($width, $height) = getimagesize($file->filepath);
}

if (($width && $height) && ($width <= $maxwidth && $height <= $maxheight)) {
return TRUE;
}
}
return FALSE;
}

CommentFileSizeAuthor
#1 inline.module.dimensions-warning.patch2.14 KBsun

Comments

sun’s picture

Status: Active » Closed (won't fix)
StatusFileSize
new2.14 KB

I've tried to come up with a patch (that is attached but not working). But it seems that there are major changes needed to let this happen.

The problem is that there is no function yet that processes inline tags only during node preview. Even if there was one I doubt that this message can be implemented easily - on previews only. So I'm marking this as won't fix.