Can't get images to display in nodes (stories) but the title appears
| Project: | Image Assist |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Hello,
I am very sorry if this problem has already been posted but I've searched through the bug reports and haven't found the exact problem I'm facing although some were similar.
So here is the problem:
I go to edit one of my stories and put my curser at the point where I'd like to input an image. I then hit the image_assist button and a popup appears that lets me choose from existing images or to upload my own. I choose one of the existing images and then give it the following settings: Title: Random Name, Description: , Size: Thumbnail, Alignment: Right, Link: Open in a popup window, Insert mode: Filter Tag.
The following code then appears in my text:
[img_assist|nid=1|title=Random Name|desc=|link=popup|align=right|width=100|height=59]
However, when I preview the story it only displays the Title where the picture should be. When I select HTML code as insert mode (this time setting Link: Not a link) the code that is put in the text doesn't even have the <img> tag. It is the following:
<span class="inline right"><span class="caption" style=""><strong>Random Name</strong></span></span>
Before you ask, yes, I have allowed the <img> tag for my Filtered HTML input format but that shouldn't matter since I have also used Full HTML as input format and that one allows all HTML. I have also checked Inline Images for both the input formats.
Please help!

#1
Is this a known bug, does anyone know something about it?
#2
Try removing width and height from the image assist tag like this:
[img_assist|nid=1|title=Random Name|desc=|link=popup|align=right]and check if it helps.#3
Thank you VERY much! Everything is working properly now.
To those of you who have the same problem, it's important to remove the width and height from the tag, as grudolf had said. However, do this only when you've selected Thumbnail size. If you've selected a custom size, leave everything be and it should work fine!
However, I still wonder why the images don't display if the width and height are present.
#4
This posting has a clear solution to what must be a bug in the latest version of image_assist. I must confess that I wrestled with this off and on for almost two months before I happened upon this solution, i.e., that removing the width and height for the photo will have it appear just fine inline in the body of the text.
Nothing should be this complicated. And I hope that all of those in the ring with me will be able to see this post and fix the problem. However, this is a manual fix; it does nothing to solve what most of us would want in a site where images can be uploaded -- something that works without any added manipulation by users.
thanks
geoff gevalt
#5
Could you please test if this bug still exists in the latest development snapshot?
#6
I am currently using the latest development version and this bug still exists for me.
#7
I have done some debugging and I think I'm on to something:
In function img_assist_display there is a variable $label. It is used to get the correct size of the image (it contains preview, thumbnail, etc...).
In my case the variable contains the value 'Preview', but the array in $node object that has a list with the images has as key 'preview' (small letters). So of course when trying to find the 'Preview'-value in the array nothing is found and thus no image is shown.
Doing something like this in the beginning of the function did the trick for me:
$label = strtolower($label);Maybe it should be worked out a bit more, I don't know.
#8
I can confirm that worked for me. I placed it in two places as displayed below starting at line 1047:
function img_assist_display(&$node, $size = NULL, $attributes = array()) {if (is_array($size) && ($size['label']) && ($size['width']) && ($size['height'])) { // custom size: should include values for$
$label = $size['label'];
$label = strtolower($label); // as per node/168617
}
elseif ($size) { // standard size
if (is_array($size)) { // size can be an array without the width and/or height
$size = $size['label']; // size is no longer an array
}
$label = $size;
$label = strtolower($label); // as per node/168617
}
else { // no size specified: assign preview size
$label = 'preview';
}
#9
@nubeli
The code you posted doesn't exist in the image assist development snapshots anymore. Please update your module.
#10
Subscribe - thanks!
#11
Guys, there cannot be done anything here without further information. As smk-ka pointed out, we are not able to create a patch against non-existing code. Please help to prove that this bug still exists in the latest development snapshot by updating your img_assist (and potentially also image) module(s).
#12
The reason I still didn't answer is because I not really understand why you say the code does not exist.
So, I just downloaded the latest dev-release (the one of 12 october) of img_assist. And I searched for 'function img_assist_display'... and well, the code is still there almost exactly the same as it was before.
I haven't tried the patch "$label = strtolower($label);" with the latest release but I suppose it just works as it worked before.
So could you please explain a bit more your point because I really don't have a clue what you are talking about.
With kind regards.
#13
I have tried to reproduce this bug with no luck. $size['key'] and $label is always lowercase. Even if custom image sizes are used.
Did you also upgrade your image module? Which version of image.module are you using?
#14
This bug exists in 5.x.1.4, which is the current release version. It appears to be fixed in the current development snapshot:
http://ftp.drupal.org/files/projects/img_assist-5.x-1.x-dev.tar.gz
Mantichora's fix is a workaround and appears to not be necessary with the development version.
I would urge that the dev version be rolled as a regular release ASAP, as the Drupal update tracker prompts people to install the broken version.
#15
Thank you very much for this clarification, yelvington!
A new stable of Image Assist will be released when these or the majority of these issues are resolved:
http://drupal.org/project/issues?projects=8750&versions=118825,152646,15...
Thus, if you would like to see a new release, please help out in those issues with testing and reviewing.
#16
OK, I have tried the dev-snapshot (also had to install a new image-module) and it appears to work without the patch.
So, this issue has been resolved.
Thx.
#17
Problem persists in img_assist-5.x-1.x-dev.tar as of Oct 18
I have a fresh install of Drupal and image-5.x-1.6.tar.gz
No image displays in the content even after deleting width&height, only
[img_assist|nid=3|title=ASC2005|desc=Come join us and get the big picture|link=popup|align=left]
Tried filtered and full html
I'm new to Drupal so maybe I missed turning something on for images?
#18
strellman, are you saying that when you have insterted an image into a node and saved it, all you see is the [img_assist ...] tag where the image should have been? If so, I think you may have forgotten to activate the Inline image filter. You need to do that regardless of which input format you're using. The installation instructions should give you an idea.
#19
Looks like this is still in the actual dev.
I have applied the above fix:
$label = strtolower($label); // as per node/168617to line 1113 and it seems to work:
// Assign preview size if no size specified.else {
$label = IMAGE_THUMBNAIL;
$label = strtolower($label); // as per node/168617
}
#20
disregard - it only worked once. It didn't change the problem.
#21
I'm getting very similar issues with the current Image Assist...
(Big Snip of my previously posted drivel occurs here.)
Actually, It seems to be working fine now AFTER I traced the problem to a call to phptemplate_image_display($node, $label, $url, $attributes) within my template.php file. I was adding portrait and landscape classes to the image and that doesn't seem to agree with the latest updates. (Even though it was working before....)
Got it working now. Thanks
#22
herb, what exactly did you do to get it to working? still doesn't work well here.
#23
Thanks. I found this in install.txt--- Administer > Site configuration > Input formats
configure an input format and enable the filter 'Inline images'.
---this worked but the following did not work
If you want to enable Inline images for the input format 'Filtered HTML',
you additionally need to click the 'Configure' tab and add
---I'm still concerned about the issue of 100s of image files in one folder, but that is another issue.
#24
FWIW, it's essentially working for me using Filter Tags as the input and the default thumbnail size. (In-line filters enabled and sequenced appropriately)
I "fixed" my previous problem by changing the theme back to default bluemarine, and isolating the problem to an image_display function call in my custom theme.
One curious issue though is that whenever I insert an image now, (either pre-existing, or newly uploaded) I get a new jpg file generated of the format filename.img_assist_properties.jpg with a width of 200px - (this size is not one of my 4 specified derivative image sizes and I'm using imagemagick as my toolkit.)
I don't know if there is any purpose to this file, or whether this is a bug. I couldn't find any current references to it so maybe someone more knowledgeable could tell me whether this should be written up as a separate bug report?
#25
herb: The -properties images are generated when you access Image assist's image properties page (where you choose the size etc. of an inline image). You can disable this feature in the settings if you like.
strellman: what exactly is still not working?
(And the 100s of images – actually 1000s in my case – is not this module's responsibility. Image handles the file storage.)
#26
Without further information I'm obliged to mark this issue won't fix. Feel free to re-open it if you want to provide further information.
#27
sorry, wrong status.
#28
Automatically closed -- issue fixed for two weeks with no activity.
#29
For the same problem still arises with the 5.x-1.x-dev as well as with the 5.x-2.x-dev branch.
[edit: I'm so sorry, the error was on my side. Please ignore this]
#30
Reverting status based on the edited comment in #29.
#31
Automatically closed -- issue fixed for two weeks with no activity.