An easier way to add images to posts (a complete rewrite of img_assist)
Yesterday I mentioned on http://drupal.org/node/32221 that I've been working on a rewrite of the img_assist module that makes it easier than ever to add inline images to posts. It has the exact same purpose as the original img_assist, but it offers these advantages:
- Tightly integrated with the TinyMCE WYSIWYG editor with a new drupalimage plugin. It converts the Drupal filter code into an image placeholder that the user can align and resize in the WYSIWYG editor. On saving, viewing HTML source, or changing the image (using the plugin) the placeholder is converted back to Drupal filter code.
- Set up so that integration with another WYSIWYG editor should be fairly easy.
- The image is linked using the image's NID, instead of the FID. That way if/when the image files are regenerated from the source the inline image won't be lost.
- Images can be resized to ANY size, not just a pre-defined list of standard sizes set by the image.module. The imaging toolkit (GD2, etc.) is used so the images are never resized by the browser.
- The workflow is simplified (in my opinion -- that's a preference of course).
- Mostly backwords compatible with the existing img_assist (you can't EDIT an existing img_assist tag with the drupalimage plugin, but existing tags will still work unless you try to edit them).
Please take a lot of some screenshots: http://www.benjaminshell.com/demo/img_assist.htm. You can also download it from my site. It may not be ready for a production site, but it's working great on my test site running Drupal CVS with the latest versions of TinyMCE and image.module. It seems to work on Drupal 4.6 as well.
Since it is a rewrite of the original img_assist module, with the exact same purpose of adding inline images to posts, I'm hestitant to release it as a new module. However, the changes are too extensive for patching the existing img_assist module. What do you think? What's the best way to release it?
Please let me know what you think. After reading the forums for the last couple years I've been getting the feeling that many people want a better way to insert inline images and so I'm trying to provide that.

img_assist integration
Benshell and I plan to merge many of these changes into the current img_assist module for the upcoming 4.7 release. We both agreed that there's no benefit in yet another inline image mod.
The concept of co-developers (i.e., other user's with CVS commit blessings) has worked very well for me, with TinyMCE being my first attempt. I hope to do more of this, especially with the ecommerce package. (Sorry for getting slightly off-topic)
That's good news
I would prefer if the fixed size option for re-sizing of images could be retained as an administrator switch based on user type.
No problem
That's interesting. I wouldn't have thought of that, but it's certainly do-able. It was a lot harder to add the functionality to let users make their image any size.
Excellent
I thought fixed sizes are useful where the images have to "fit" a format for a node - makes it easy for users to upload/resize to fit the requirements?
We'd love to have this for 4.6
Please use my contact to get in touch.
Anyone else want to pony up a bounty to have this backported to 4.6? Unless, Ben and Matt, you can let me know if this is not possible?
Where is the appropriate
Where is the appropriate place to post feature requests for modules? I have previously asked about features for this module and received no reply?
http://drupal.org/node/31882
http://drupal.org/node/31709
Issues are the correct place
Feature requests are just feature requests, though. The developer may not be interested in adding that feature, or may just be busy (it's only been a week since you posted).
Rewrite of img_assist doesn't work
hello Benjamin,
Your rewrite of img_assist is exactly what I want. Thanx a lot !
Unfortunatly, it doesn't work. When I push add an image (the camera of the first version of img-assist is no more here. Normal ?), a pop-up opens but in it, there is the message page not found.
I think that I did not install well.... But don't know how to fix the problem.
Thank you very much for your help !
Lisadol
A couple ideas
Since posting here I've become aware of a problem with using the TEXT link with TinyMCE for adding new images... I need to talk to the authors of the TinyMCE module about a resolution. The TinyMCE module has extra code in it to support the original img_assist module, but it is interferring with the rewrite I did.
In the meantime, you can use the img_assist "add image" text link without TinyMCE; or you can use the drupalimage plugin for TinyMCE. Either one of those should work.
I'll also try to get a fix or workaround figured out for the text link with TinyMCE as soon as I can.
Thanks for trying the rewrite, and thanks for your patience.
im' having the same problem
Hi,
i'm having the same problem. after upload the image, the browser displays "page not found".
did u ever got it to work? could u share ur experiences? tks
A Little Direction Please...
OK, I've downloaded your new version and unzipped the file. I'm a little confused regarding the contents. Obviously the unzipped drupalimage folder goes in the plugin folder of tinymce. No problem there.
Now, here is what I have.
tinymce.module replaces the same in the /modules/tinymce folder.
img_assist.module,
image_assist.js
image_assist.css all go in the /modules/image_assist folder
Where do the following go:
tinymce.js - someplace in the tinymce folder, but where?
textarea.js - beats me on this one. Where does it go?
Additonally, in the install.txt file, for 4.6 you reference the following:
"There is section in this function (starting around line 282
of tinymce.module) that says:
switch ($theme_name) {
case 'advanced':
$init['extended_valid_elements'] = 'a[href|target|name|title|onclick],img[class|src|border=0|alt|title|width|height|align|name]';
$init['theme_advanced_buttons3_add_before'] = 'tablecontrols,separator';
$init['plugins'] = 'drupalimage,table,emotions,fullscreen';
$init['theme_advanced_buttons3_add'] = 'drupalimage,emotions,separator,fullscreen';
break;"
But, in the tinymce.module file included in your zip file, these lines are included:
"// Add some extra features when using the advanced theme.
switch ($theme_name) {
case 'custom':
$init['extended_valid_elements'] = 'a[href|target|name|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]';
$init['plugins'] = 'drupalimage,emotions';
//$init['theme_custom_buttons1_add_before'] = 'drupalimage,emotions,separator,';
//$init['theme_custom_buttons1_add'] = 'drupalimage,emotions,separator';
break;"
Are the changes in the install.txt file to be made here? I am bit confused and that confusion has made both image_assist and tinymce inop for me.
Thanks in advance for the help.
Sorry for the confusion
All the files go in the img_assist directory unless otherwise noted. As you've correctly observed, the optional drupalimage plugin goes in the TinyMCE plugins directory and the replacement 4.6.3 version of tinymce.module goes in the tinymce directory. Otherwise everything goes in the img_assist directory.
As for the differences between the tinymce.module file I included and the install.txt file... follow the install.txt file. I just fixed it so they should be the same now. The tinymce.module file I had included came from one of my sites where I'm using a custom TinyMCE theme.
Thanks
No problem and thanks for the info. Downloaded your new stuff. This is exactly what I was looking for; an easy way to insert images and have text wrapped automatically. Awesome!
I finally got down to trying
Sorry if I am asking the same question as the poster above, but I finally got down to installing and enabling this module, but must confess to still being confused.
I didn't have any trouble copying over the 'drupalimage' folder into the following path mentioned in INSTALL.txt:
\modules\tinymce\tinymce\jscripts\tiny_mce\plugins
INSTALL.txt then talks about enabling the drupalimage plugin and here is where my trouble starts. I am using 4.6 version of TinyMCE. So, should I edit the tinymce.module file as mentioned in INSTALL.txt?
Or, can I replace the existing tinymce.module with the one provided in the rewritten img_assist folder? I am assuming it contains the edited version of tinymce
Really sorry if this sounds like a dumb question.
Correct
That is correct. You can either edit the tinymce.module file yourself, or just use the one I've included (for Drupal 4.6.x only).
Thanks, benshell.
Thanks, benshell.
doesnt work properly with tinymce
i must have done some stupid mistake in installation but i cant understand where.
i use a tinyMCE 4.6.0 and substituted the tinymce.module in the tinymce dir with the one provided in the img_assist.zip file.
tinymce is not displayed anymore and i have this message displayed at admin/settings/tinymce (in line, i mean it's an error message within the tinyMCE admin page):
"Could not find the TinyMCE engine installed at modules/img_assist/tinymce/. Please download TinyMCE, uncompress it and copy the folder into modules/img_assist."
---
i just tried to start all over again from scratch. now that error disappeared and tinymce works with the new tinymce.module provided with the rewritten img_assist module, but:
- if i click on the tree icon (insert/edit image), it seems like tinymce doesn't recognize the drupalimage plug-in (which i did copy in the correct folder).
- if i click on the camera icon (upload img), i have a 404 error in the windows that pops up
any help is appreciated :-)
Wrong directory
TinyMCE should be installed in /modules/tinymce/ (not inside the img_assist directory).
since it found a
since it found a tinymce.module file in that directory, fro some reason it was looking for the tinymce engine as well. deleting the file was enough to solve that problem.
Could not find the TinyMCE
Ah, you have to download and install the tinymce module from http://tinymce.moxiecode.com/. That is, you need both this module *and* the drupal tinymce module.
See the install.txt of img_assist for the correct path for installing this module.
thank you for previous
thank you for previous replies, still have the following problem:
- if i click on the tree icon (insert/edit image), it seems like tinymce doesn't recognize the drupalimage plug-in (which i did copy in the correct folder).
- if i click on the camera icon (upload img), i have a 404 error in the windows that pops up
the rewritten img_assist folder is in the modules dir. the drupalimage folder is in modules/tinymce/tinymce/jscripts/tiny_mce/plugins.
did you
Did you previously have img_assist installed? I noticed that it was still loading the previous drupalimage plugin instead of the new one. I think, for some reason, that the .js file is cached and it is still trying to load the old page which is giving the 404 error. Try clearing your site cache or wait for it to clear and it should work!
Checked and checked and checked again but ......Please help
First, thank you for a wonderul module and all your work. On its own img_assist work wonderfully but the minute I enable tinymce the problems start. When I click add image the pop up opens - If I click insert nothing happens and if try to upload i get the following error:
warning: Invalid argument supplied for foreach() in /home/esh0002/public_html/drupal/modules/image/image.module on line 329.
warning: Cannot modify header information - headers already sent by (output started at /home/esh0002/public_html/drupal/includes/common.inc:384) in /home/esh0002/public_html/drupal/includes/common.inc on line 192.
The title of the image remains in the gallery.
What I've done:
- I uploaded your tinymce module as specified replacing the original module
- I copied over the drupal image plugin into jsscripts/plugins directory
- I removed the tinymce module from img_assit folder.
What I have:
drupal 4.6.5 (could this be the problem?)
tny-mce 4.6
img_assist your realease.
I'm sorry if I have missed something that has already been posted. But I went over and over this thread and checked and still nothing. If I disable tnymce though img_assist works perfectly.
Any help / guidance would be greatly appreciated.
Where is the direct link to
Where is the direct link to download the modified version of img_assist?
-zach
------------------------
harkey design
Image.module and img_assist.module - any reason why seperate?
Could someone explain why Image.module and img_assist.module are seperate any benefits of doing it so? - from user/usage point of view.
also looking into the cvs. (4.7) that image.module is not one of the default, again is there any benefit of it?
-imho- image handling is not optional for most websites or cms's but essential part of it.
i would extent the necessity to a media.module, sections handling -image, video and sound combined to be step ahead from all other CMS' or CMF's or whatever you define in an opensource 'product'
Seriously...
Seriously. We're used to it, but it has to be disheartening for a new user be able to create a 'book page'(!?) but not an 'image'. Seems like I've heard about native image support before, but like ica says, I don't see it in the cvs; or is that not how it works?
-zach
------------------------
harkey design
I agree
Yeah, I agree. It seems like this gets discussed every few months on Drupal.org, but image handling still isn't built in. I think it's heading that way though. Image.module has become so simple (and featureless) that it's a good base for other imaging and media modules.
Just What the Doctor Ordered
Thanks benshell! Finally a image inertion module that actually works! You are my god.
Kindest Regards,
gtoddv
I'm glad you like it! :)
I'm glad you like it! :)
Checkbox option to delete original image
I just submitted a feature request (I hope I did it in the right spot) that says:
As ejort mentions here, I'd love to have a checkbox that gave the option to "Delete original image" (the one that you're uploading) so I/Drupal user can just use the resized/resampled image.
Another commenter suggested, "Just resize before upload." which I know how to do, but most of my clients (Drupal users) don't know how to do and they're going to upload their 2 MB images from their digital cameras and wonder later why (1) their servers are full, (2) the images load slowly, (3) you get the idea.
Thanks,
- Bradley
Actually...
Actually the correct place for this feature request would be the image.module page: http://drupal.org/project/image. The actual uploading and storage of the image is unrelated to either version of img_assist.
Also, I don't know if this feature request is possible... the original image is used everytime a new image "derivative" is made (just as thumbnail). However, keep in mind that the "original" is actually recompressed from the real "original", so it'll probably take less disk space.* Also, you may be able to limit the image upload filesize or dimension. Each of these were options at one point, so hopefully they still are.
* This was true the last time I checked. Personally, I'd rather it DIDN'T work this way. I'd like the keep the originals in the highest possible quality.
update to 4.7
From what I see here this module is being developed for 4.6? Is that correct?
Will it be possible to use this in 4.7 when it arrives?
wellsy
like someone else here said "always use a test site"
permit me to add "backup your database regularly"
orchidsonline.com.au
Yes
Yes, last time I checked it still worked with CVS so it will probably work with 4.7 without a problem. If it doesn't, I will fix it.
Excellent!
I will follow this with great interest!
Need any help with testing?
wellsy
like someone else here said "always use a test site"
permit me to add "backup your database regularly"
orchidsonline.com.au
Hey this is going the right direction!
Benshell, I really appreciate the work you are doing. As a designer, not a programmer, I am kinda at the whim of your efforts.
Adding a way to get images into posts easily is probably the biggest drawback of Drupal for me at this time. Sure I can use some code to get the images I have to show in posts, but that is a real pain.
What I would like is to have an image float left and to have text wrap around it nicely. I would also like all images to be 20% as wide as the column I am working with, and when you click on them, a full size picture of the image opens in its own window.
for a live example of what I am looking for, look here: http://main.greasyfur.com
Obviously I have to tweak this code for every picture. It also has the disadvantage of having the browser redraw the picture smaller, rather than GD.
I loaded your version of image assist, I was able to get the window with the thumbs to come up, but when I click "insert" nothing happens. Have I done something wrong or stupid? I also had big problems with the original image_assist, which I could not get to do what I wanted at all.
I am using drupal 4.6 on a server hosted by hostgator.
Details
Thanks, I'm glad you like my work so far.
Let me see if I understand the image workflow you want:
1) You want the images to always float left, never right. My version of img_assist gives you a choice of left/right... but for your purposes would you like to see the choice removed?
2) You want the images to be 20% of the width of the "COLUMN YOU ARE WORKING WITH". Does that column width vary? Or can all img_assist thumbnails be setup to always use a specific width in pixels?
3) Are you using TinyMCE, a plain textarea, or something else? And are you using the "Add Image" link, or the drupalimage plugin for TinyMCE? I haven't had any problems using it with TinyMCE, the drupalimage plugin, and clean URLs, but I haven't thoroughly tested it with other configurations.
4) The link to the full-size image in a popup window is something I'd like too, so I will definitely add this to img_assist (hopefully soon, at least before Drupal 4.7).
hey, thanks for such a quick reply
1. the choice is fine - I may not have gotten to the point with your version of img_assist to allow me to see that. As long as it can float so text wraps around it.
2. Yes - the column I am working with - visually, I like it when the images are all the same width. It doesnt have to be a percentage - I just found that easy to work with in the script that I have. I could just as easily specify the width in pixels. Generally, I like fixed width templates better than the ones that stretch with the page.
3. Yes I installed TinyMCE, and it works fine. I did use the add image link, and I did replace the TinyMCE module with your modified version. I am also using the drupal image pluggin, and clean urls. I am using firefox on mac osx. Dont have access to a pc at the moment tor try there. I may have messed something else up in my fussing with it all. I could take it all out and try again.
4. Cool, full size image in a pop up window will be great. I like how the audience can get a larger picture with out dealing with navigation, leaving the page, etc. Very user friendly design I think.
I have been poking around for this info, but have not come up with it yet - do you know when drupal 4.7 is slated for release?
Thanks again for your efforts.
module not working :(
Unfortunately, I am also encountering this problem - I can't get the drupal image camera to work, and if I click on the text link to insert an image, I get a window from which I can choose my image, but when I click "insert" nothing happens.
Any tips on how to get the drupalimage plugin working?
I am using drupal 4.6 hosted on a Windows Brinkster account (which I cannot reccomend).
Michal Ehrman
Boutique - Online Fashion Magazine
http://www.boutique.co.il
Questions
I don't know. It should work if you're using Drupal 4.6.3 and the version of tinymce.module that I included with this rewrite of img_assist. Is this is fresh Drupal install? Have you previously installed other versions of img_assist and/or TinyMCE (not that it should matter, I'm just wondering)? What happens when you click the drupalimage camera icon? The "Add Image" link doens't work with TinyMCE, but what if you turn off TinyMCE... does the "Add Image" link work then?
Anyway, these are just things to consider. I probably won't be of much help for the next couple weeks... I'm in college and have a couple final projects that are taking all my time.
Now that I have been using it
Just a couple of requests.
1. Can the drop-down box be the list of image galleries instead of my images (and if configured taxonomy terms)?
2. Can we have a text box for configuring the padding for the text wrap?
Thanks again for some great work. This is the type of stuff that will really make drupal appeal to the greatest number of folks.
gtoddv
Clarification
1. I'm a little confused... the drop-down box does show taxonomy terms (in addition to "my images" and "all images"). However, I will acknowledge one weakness here that I plan to fix ... the drop-down should only show taxonomy terms (galleries) that have images in them (no empty terms in the list). There should also be an option to put the number of images in a term in parenthesis: Term One (32 images), Term Two (11 images), Term Three (2 images), etc.
2. The padding can easily be set in the stylesheet. Is there a reason you'd like a textbox for this? I'd rather keep the form as simple as possible.
First of all, great work.
First of all, great work. I am so into this. My users are already thanking weeping in joy.
After some testing, the main item that keeps coming up is the upload form. The fact that it uses the main stylesheet but not the actual page template causes most of my layouts to get munged up. Also, the pop up window is just too small (and not resizable) to accomodate the entire image node creation form.
Tell me what you think of this idea: Instead of presenting the full create image node form in a small popup window, what if it presented a greatly simplified on the fly form that only had the absolute minimum:
1. Title
2. Description
3. Image upload button
If the user wants to specify Authoring information, Options, User comments, path aliases, Input Formats, Attachments, Menu OTF, etc. he can use the normal 'create image' option on the website, and don't forget he can always go back and make changes to the other fields later anyway. But otherwise the streamlined form should just use the defaults without presenting them.
For the image galleries I suggest a default img_assist gallery that all images are posted to at first (they can always be moved later). Maybe the user could even specify it in the img_assist settings?
-zach
------------------------
harkey design
I need upload to user-specific folder
This would suit me if I could stipulate that a user can ONLY upload to a default folder that I specify for each user - eg /$UserID/
In my situation it is not appropriate for multiple users to see other user images.
I think the only way to do this
I think the only way to do that is to bypass the image module altogether. Perhaps using the htmlarea method described here.
Also read:
Using Upload Image
How to have public and private image areas
-zach
------------------------
harkey design
Thanks for the suggestion,
Thanks for the suggestion, however I have multiple users who manage their own images and I want them to only ever have access to their own images.
I haven't investigated this deeply yet, since Benshell is doing such a great job, but filtering images somehow might be a simple option for me?
Options
If there were an option to use a default img_assist gallery that all images are posted to at first (as Zack suggested), you could always filter them by user ID. If I added that option, and also a option like this:
Browse images by:
[ ] My images
[ ] All images
[ ] Categories
Would that work for you? No promises, of course, but if you need this feature, probably a lot more people want a feature like this too.
I just need a means of
I just need a means of allowing users to ONLY see their own images. Imagine Avatars, as an example, there is no way you would want all uploaded avatars to be accessible to all users. I want the same sort of restrictions to be enforceable for all images - don't really care what technique is used, but the option of viewing "All Images" - is NOT an option for my needs.
Thanks.
I love it.
I love this idea. I've been trying to think how to make general pics available to all users but so they cold upload their own picture posts as well.
My thoughts
Thanks, I'm glad you (and your users) like it.
I agree with you about the upload form. I don't like how complex it is either. I'll get to work on that at some point. You're also welcome to get a head start on this if you want to.
However, I'm not sure whether or not to include a taxonomy drop-down. The way I've set up the workflow on my site is I made images "not published" by default. Users can upload pictures to whatever galleries they want, but the images won't actually show up in the galleries unless an admin publishes them. However, they will still show up inline in their post(s). Img_assist will display a photo that is unpublished. However, img_assist will not let others use an unpublished photo if they browse by "all images". It may not be the intend use of Drupal's "not published" option, but it does seem to work well. Plus, an admin can quickly publish a lot of photos using "administer/content", whereas I don't know of a way to quickly assign taxonomy terms to multiple nodes.
What do you think of this workflow? Let's keep this discussion going. There are different ways to do things so let's figure out what is easiest for most people.
That is incredibly
That is incredibly interesting.
Experimenting.
-zach
------------------------
harkey design
Really like what you are doing with this, but having a problem
Have it working fine on one site, but on another site operating off the same code base I'm getting errors relating to not finding "node_revisions" table - I think this has to do with the fact that I was using the old version of img_assist on this site, but had not used it at all on the site that works. But neither site has a "node_revisions" table. Looking at the image_assist.module source, this appears to be related to legacy code, but I'm not quite sure what to do about it. Would really like to be using this, the integration with TinyMCE is so much better. Any suggestions would be greatly appreciated.
Also, is there a newer version of your module available for download?
Thanks,
T
I will test this
I'm trying out this new incarnation now... fed up with the old img_assist and looking for a solution. I also can't get HTML-area to work (xinha).
Figured it out
Well, now there's a newer version. The 'node_revisions' table is only in CVS, not Drupal 4.6. I based my version of img_assist off the CVS version of img_assist, and I didn't test these legacy functions with Drupal 4.6 (since I don't use them).
I replaced img_assist_load_images() and img_assist_load_image() with copies from the 4.6 version of the original img_assist. Hopefully this will fix the problem (and not cause any new problems for those using CVS.
Thank you!
Works great now! Just what I needed. Now if it only worked with AcidFree as well ;-)
Great work!
Acidfree support
Really...
Are there no plans to incorporate acidfree support into img_assist?
Matyas
Clean URLs no longer required
I just made an update so that img_assist will work without clean URLs. No need to upgrade unless you need this.
As far as I see it, the
As far as I see it, the ability to easily choose/upload images on the fly is the single most important feature lacking from Drupal (It's almost a dealbreaker).
I've been testing this version extensively and here are my thoughts, and notes from watching over the shoulders of 12 brand new users (a design class I teach) one at a time as they attempted to place an image (followed by a list of possible improvements). Note: I am not using Tiny HTML Area, but I am using Markdown.
Overall. I like the ability to generate a new sized image on the fly, but not if it comes at the expense of the defaults. My users are constantly breaking my layouts. The best thing about the image module is that the admin/theme designer can determine an appropriate thumbnail and preview size (exactly, to the pixel) for the layout/theme/node, but the user doesn't have to think about it. They just upload whatever sized original they want and the preview size fits perfectly. (I tell them as a rule, don't upload anything larger than 1000px wide or it'll take forever to upload, and that does the trick.)
The problem with the current implementation is that in most situations, the user is going to want to use the default sizes, and this makes it very hard because they have to manually enter it in every time. Which means they have to go look in their notes and see that it needs to be, for example, 465px wide for a perfect fit.
The problem is they don't do this. They either just leave the default values of 200 x whatever, (which are hard coded into the module so even if I change these values in the code so that it defaults to my preferred size, all my sites (30 or so in a multisite setup) inherit the same value and they all have different size constraints. Even if they do take the time to enter the appropriate value that I specified for the thumbnail for instance, instead of using the existing thumbnail, it creates a duplicate.
I have spent many hours considering the best way to handle these things and here is an detailed list. I realize some of these aren't exactly quick fixes and I'm trying to determine the best way to move forward myself, but nonetheless here's the list:
When clicked, the image should:
[x] Do nothing (not a link)
[ ] Go to the image's standard node view (preview size)
[ ] Open original in popup window
[ ] Go to [http://___________________________]
I still haven't addressed the taxonomy/gallery situation, but I wanted to get these ideas out there. If it would be helpful, I am willing to comp up some static UI screenshots to fully flush out the flow. I would also love to help in any other way I can. I'm kind of confused about how this version is being developed. Is it officially been absorbed into the existing img_assist module? Is it in the CVS somewhere? If I make some modifications to the code, is there a place where I submit a patch?
-zach
------------------------
harkey design
Wow, that's a big
Wow, that's a big list.
Lastly, my version of img_assist is completely unofficial, and it is not part of the CVS. I developed it for use on my sites, and I released it because Drupal has been behind in the area of inline images, so I'm trying to help it catch up. I will continue to develop and maintain this version of img_assist until one of the following happens:
Download from where?
Where can I download your version to test? All I'm looking for is to wrap test with image. I've been trying upload, htmlarea, etc., so hopefully you have the solution. TIA
=====
Drupal hosting - Up to $70 off, use coupon: HOTPROMO
The link
The link is in the first post. Here it is again:
http://www.benjaminshell.com/demo/img_assist.htm
thanks!
Thanks! After reading through all the posts, I wasn't sure if the updates were being applied to your version, added to the other one mentioned or deposited to cvs.
=====
Drupal hosting - Up to $70 off, use coupon: HOTPROMO
Screenshots
Hi, I am very much interested in adding the image upload functionality to my site. At the moment I am looking at several solutions and not sure which one is the best to start with :)
Is it possible to see some screenshots to get the feeling of what's the proposed solution is like?
Yes
Yes, if you follow the link in the first post (to my site), you'll see a few screenshots.
Installation screenshots
Nice screenshots. In my turn I made a well-screenshotted and detailed tutorial on img_assist installation. On my home PC I integrated it with TyneMCE and it works just fine. I think I'll try HTMLArea (or whatever it is called nowadays) also. Then I'll create similar detailed installation tutorial on img_assist + TinyMCE (and/or HTMLArea :))
Suggestions for the future
This looks very nice. Well done!
An idea that you may want to look into i would love to see done, instead of popping up a new window which the user has to juggle, why not try putting it on the same page using a collapsible fieldset with an IFrame in it. Its not a too distant jump from what you already have now ...
That's possible
That's possible. I think I prefer the popup window though because an iframe would be limited in size because of the fixed width of many websites. However, if you can neatly integrate this functionality into the existing system as an option, I'd be happy to add to the release. Otherwise though, I probably won't be able to free up time for this (unless one of my clients wants this too).
I think we really need an
I think we really need an upload status indicator. It isn't uncommon for an image to take a full minute to upload and during this time there is no feedback to the user, who is likely to think the upload failed or their browser froze.
It doesn't have to be an accurate progress bar, just some kind of message that says, 'image uploading, please wait.' and maybe a small looping animation. It would also be cool if we could disable the submit button (gray it out).
I really think this is an important usability feature.
Now that I think about it, is this something that should be implemented in img_assist, or probably image/upload module, or maybe even Drupal core?
-zach
------------------------
harkey design
Permissions...
Maybe this has already been done in the 4.7 version (which I have not downloaded), but in the 4.6 version doesn't seem to have user permissions or a good way to restrict img_assist by page type. I'd like to have it only available to "power" users and want to turn it off (for all users) for forums and comments.
True
That's true, there are no permissions in img_assist (neither my version or the original version). Do we need a separate permission for this? Or can we just rely on the image.module permission to create an image?
Status indicator
Another good (but difficult) idea, Zach. :-) I can see it working like this:
1) Make a new upload page for img_assist (instead of just calling the standard create image form).
2) When clicking Submit, use Javascript to (a) launch an status overlay using CSS, (b) write new HTML/CSS code to a placeholder on the upload page, or (c) launch a popup window with a status indicator. I think (c) would be the easiest.
3) The image would continue to upload, and then go to the next page. That page would have to check for and close the popup window (if the third method were used).
I'm all for this if someone wants to do it. :-) Otherwise, maybe I'll get around to it someday.
status indicator
I think a status indicator is an excellent idea which will reasure users on a slow connection that things are still underway.
A cancel option may also be good to bail on the upload if is taking forever.
wellsy
orchidsonline.com.au
link-attribute
Here's a one-line-patch to make the link-attribute work. It links to the image node if |link=1| or any other value. Using only |link| doesn't work. You might also use the
$attributes['link']as a url easily, that is, treat this attribute as an url-string not a boolean value. I.e: |link=http://some.url/|--- img_assist.orig/img_assist.module 2005-11-04 18:33:04.000000000 +0100
+++ img_assist/img_assist.module 2005-11-24 20:14:00.000000000 +0100
@@ -632,7 +632,7 @@
$output = "<div class=\"inline\" style=\"float: {$attributes['align']}\">";
if ($attributes['link']) {
- $output .= l($link, $img_tag);
+ $output .= l($img_tag, "node/" . $node->nid, array(), NULL, NULL, FALSE, TRUE);
} else {
$output .= $img_tag;
}
Thanks
Thanks, I haven't tried it yet but it looks good.
Module not working :(
Unfortunately, I am *also* encountering this problem - I can't get the drupal image camera to work, and if I enable the add image text link and then click on the text link to insert an image, I get a window from which I can choose my image, but when I click "insert" nothing happens.
Any tips on how to get the drupalimage plugin working?
Or how to get the text link working?
I am using drupal 4.6 hosted on a Windows Brinkster account (which I cannot recommend), not using clean urls.
Michal Ehrman
Boutique - Online Fashion Magazine
http://www.boutique.co.il
Double post
You've posted this question twice. Please see my reply to your previous post.
how difficult would it be to
how difficult would it be to make it also compatible with images uploaded to a menalto G2 gallery ?
also, i found a rounding error: i uploaded image.jpg using this new img_assist module, changed nothing to the suggested view size (200x155) and got the following results:
original size = 1642 x 1276
img_assist preview size = 200 x 155
img_assist view size = 199 x 155
it would also be great to have a single file for the preview generated by the image module and the one generated by the img_assist module
regards,
thx for this wonderful module
Questions
1) I don't know... how are the images in a menalto G2 gallery saved as nodes? If not, it'd be extremely difficult to make this work.
2) I'll have to look into the rounding error. I wasn't aware of this.
3) Do you mean have it so img_assist does not create it's own image derivatives and only uses the predefined image sizes?
3) => well i mean
1) => some existing modules allow to insert G2 pictures into nodes, i'll try to checkout how they achieve this
3) => well i mean foo.img_assist_preview.jpg is used to display image previews when you are about to insert an image inside a node. why not use the preview generated by the image module itself. with lot of images, this would save space.
Brilliant!
I could write a short book about how incredible this aspect of things is (tools to make it easy easy easy for the "average end user" or "web site owner" or contributor to put text and graphics on the internet), but I'll try to refrain... Other than to say, as others have mentioned regarding the general topic, there probably isn't anything more central or basic when it comes to the "comfort level" of that "average end user." And, from what I've seen, img_assist (with the image.module) takes care of the graphics part of that equation in a way that should make it possible for even those nearer the "average end idiot" end of the spectrum (people like me), to be able to include images with near-zero knowledge (of anything) and one eye closed...
Exellent job!
I also want to say that this particular thread is one of the best I've come across on the Drupal site. I'm sure there are many more like it, but everyone who's contributed to it ought to know it's: A) an impressive display of intelligent collaboration (a nice mix of things from "experts" and "not so experts," and good all around input from all concerned); and B) one that I found particulary helpful.
For example, Artem's "Installation screenshots" and "no-brainer" instructions made it possible for me to get the whole thing downloaded, installed and, wonder of wonders, working in something like 15 minutes... Not only that, but after installing everything, something seemed not quite right. Mainly, I couldn't see/find the options to position images on the right or left. After another 15 minutes of wondering and looking more closely, I figured out I ought to download the newer version from the page linked in Benshell's initial post. Made that switch and presto! All fixed.
And here's what's "impressive" about all that: As mentioned, I'm new to Drupal, don't come close to understanding it yet (taxonomy, vocabularies, books, nodes, etc.), and while I get the concept of modules and have looked them over (a real candy store!), I hadn't dared mess with any of them. So, being a near-average end idiot, it's only natural that the first thing I'd try to figure out is how to make it easy for people to insert graphics into whatever text they'd be adding to whatever sites I'd put together with Drupal... Never mind site structure, linking, etc. (see taxonomy, etc. above), let's just jump in here and see about getting a photo into a "story!"
And - thanks to img_assist and this thread (and Artem's guide for those in a hurry) - it looked like it might be, and, more importantly, actually was, a snap. So thanks everybody! This has been a good day for at least one Drupal beginner that will make things a LOT easier from here on out, no doubt (now that I've got this module installation things down and all - "Piece of cake" ;).
Okay... Pardon the length. I must be excited. And for all that, I do have a question that pertains to the images.module galleries... While I understand the necessity of the galleries being there, how can I set things so they don't show up as part of the "visible" site? That is to say, is it possible to set galleries to "invisible" so their only purpose is to serve as a "background repository" for the images placed via img_assist and not as "content items"? (If that makes sense.)
Also, is it possible for people to edit an image (right or left placement, description, etc.) after it has been inserted? Is there a way to bring it's img_assist "file" back up to edit the same way a story can be editied or is it best/simplest to just delete the code from the "story" and "re-add" the image? (If that makes sense).
Thanks
Thanks! I'm glad you found this thread (and my rewrite of img_assist) to be useful. It's posts like yours that encourage me to keep contributing to the Drupal community.
To answer your questions:
1) The way I handle "invisible" galleries is I change the default options for the "image" content type to "Not Published". To this (on Drupal 4.6.x) go to /admin/node/configure/types/image. Uncheck the box "Published". This way you can create images using img_assist and they will not show up in any galleries, taxonomy pages, etc., but they will still show up in my version of img_assist. However, if you want to publish some photos, you can always go to administer / content and publish certain images. Just check the boxes by them, and from the Update select box choose "Promote the selected posts", and then click Update.
2) You can bring the img_assist window back up to edit the image properties, but currently only with the TinyMCE plugin. If you're looking at the plain text img_assist tags, you can still edit them but there's currently no way to bring the img_assist window back up.
Update
I made a small update today to my version of img_assist:
I also moved the float left/right CSS into the img_assist.css file, per an earlier suggestion. That required me to also set up img_assist.css to be referenced from every page (it wasn't this way before).
Second, I fixed a bug that was preventing the editing of existing img_assist tags with TinyMCE.
And finally, I added a "link" field to the img_assist form (which affected several javascript files including the drupalimage plugin for TinyMCE). The PHP code in theme_img_assist_inline() controls how the link string is used. Right now it's setup to link to the URL specified, if the link string uses a proper URL format. It links to the image node if the link string is anything else. And of course there is no link if the string is blank. More advanced functionality can be added later, but I wanted to get the basic linking functionality into the code now.
I faced a situation where a
I faced a situation where a left-aligned 200x155 image was inserted at the beginning of a story, on the left.
The teaser text was so small that the image was also floating left to the title of the next story which totally broke the layout: it would have been better to have the title of the next article start below the image.
I guess this problem is due to the fact that DIVs do not stretch unlike table cells.
Also, when using the excerpt module, it would be great to be able to specify a smaller size for the display. More generally, it would be great to be able to display the same image multiple times with different sizes. As a consequence, you would have:
foo.img_assist_view_x1_y1.jpg
foo.img_assist_view_x2_y2.jpg
where x1,y1 are the dimensions when the node is read in full page and x2,y2 are the dimensions used when teaser is displayed
finally, having a link to the original image node like the original img_assist does would be great, but this will be resolved with the merging :)
kind regards,
g.
I like your update, but
I grabbed the latest version and used your version of the tinymce.module. I have the advanced theme working with the camera link and tinymce running fine.
The pop-up window works well, except for one thing. It doesn't close when inserting the image. I get an error:line 77, char 5, object doesn't support this property or method.
The url reported in the error is:
"www.mysite.com/drupal/modules/tinymce/tinymce/...../themes/advanced/index.php?q=img_assist/tinymce"
I assume the error is triggered when the pop-up tries to close.
Oh-- and I'm getting that aforementioned error using Internet Explorer 6 on a Windows Xp SP2 machine (if it matters).
Also, is it me, or is img_assist placing a border around each image?
Other than that, this is a great mod to the img_assit module. It seems to work better than the officially contributed version. Good job and thanks!
4.7, cvs, unfork?
So, like many other drupal devs, I'm moving some sites to 4.7. I've come around to the rich text editor/image management phase of the deployment, and, lo and behold, img_assist is broken.
We desperately need a well-supported image manager. TinyMCE is the editor of choice, so there should be no gotchas when running them together. Moxiecode has a good one that is, or soon will be, integrated with drupal (authentication etc). ATM, I'm willing to pay $40 for something that works. Long term, though, let's get this problem solved!
Concerns:
Benjamin, Matt, what's the plan?
Respectfully,
Eric D
4.7 Plans
I completely agree with you. This code *should* be in CVS, it *should* be merged with the original version, and it *will* be ported to 4.7.
I don't know what Matt's plans are for 4.7, and I haven't talked to him lately about the possibility of merging the two... but I'm working on a 4.7 version of my rewrite. I hesitate to give a release date, but if you need a 4.7 version right away and are willing to contribute a little then this will take a higher priority. I could probably get the port done this week if I work on it. Email me if you're interested in sponsoring this development.
From my perspective, the problem with merging is making the big decisions: Who decides what the future version looks like? Who is going to maintain it? I don't know how I could "merge" the two... after all, I started with the original img_assist and completely rewrote it. Besides the same name and similar filter tags, the modules are completely different. A few big changes that come to mind are:
1) Images are referenced by the node ID instead of the file ID.
2) My version integrates much better with TinyMCE. This required extensive re-structuring of the code. It should also be possible to integrate my version of img_assist with other WYSIWYG editors.
3) Image derivatives are created for any size, whereas the original version doesn't create it's own derivations. It seems like not everyone likes how my version creates derivatives (even though I thought this was an essential feature), so perhaps an option can be added to stop it from creating derivatives.
As the "unofficial" img_assist developer I'm not in the position to make a decision regarding the merging of the two versions. However, I plan to continue working on img_assist as long as my version is needed.
Ben, the more I think about
Ben, the more I think about it the more I wonder if the filter tags are necessary at all. Personally, I would much prefer the straight html. Does TinyMCE demand filter tags or does it work fine with straight html? I don't think that the filter tags are that much easier to use, especially for users familiar with html who have to relearn the syntax for a filter.
I've found that that my users don't mind seeing or copying and pasting html, they just don't know how to write it. If Tiny can display(wysiwyg) straight html then in my view that covers all the users who can't abide seeing any html at all. Everyone else can use the html.
Dumping the filter tags in favor of straight html has the additional advantage of being independent of the img_assist module for display. It is also more forward flexible and future proof.
I interested in sponsoring these changes and several more. For instance, I really want the user to have the option of making the image a link, and to give them the choice to link to a) the full image node, b) any of the derivatives, including original, in a popup window c) an external url
This functionality is incredibly important and easy enough to do — I can work in the interface and markup/css — if the output is straight html instead of the limited [filter syntax].
A lot of the time I find myself using the img_assist module to choose or upload an image, just so I can pluck the node id number out of the filter tag and replace the output with:
<a href="/image/view/22/_original" rel="original"><img src="/image/view/22/thumbnail" class="left" alt="" />
</a>
I have a javascript that makes any link with
rel="originalopen in a new window, which incidentally resizes to fit the image.But it would be so much easier if the img_assist module would output this html to begin with.
This is the kind of deluxe functionality my users want and it's what I need out of img_assist, and I'm willing to contribute as much time and money as I can to get it working.
Let me know what you think and if/when you could start.
-zach
------------------------
harkey design
HTML vs Filter Tags
TinyMCE works only with HTML, actually. The drupalimage plugin converts the filter tags to HTML for TinyMCE, and back to filter tags before TinyMCE exits. As far as the TinyMCE is concerned straight HTML would be easier.
HOWEVER (there's always a catch, or two), there are additional data fields that are not part of HTML tags. The NID, title, and description are joined together and put into the ALT or TITLE attribute when the drupalimage plugin converts a tag to HTML for TinyMCE.
I suppose the NID could be removed if you don't want the ability to edit existing images with img_assist.
And I suppose the title and description could be joined, but personally I like having them separate so that in the theme I can bold the title, add a colon, add a space, and add the description.
I also like to theme the title and description to show in a div below the image. If this were done in HTML without the filter, it would be a look more complicated than a simple filter tag. It would also be easier for people to mess up the code and break pages. With TinyMCE it'd be harder to realign and move images, because in the WYSIWYG view you could move the image but it wouldn't move the DIVs. Here is a comparison:
[img_assist|nid=809|title=PummelCo|desc=CD-ROM Design|link=node|align=right|width=250|height=231]<div class="inline right"><a href="http://www.benjaminshell.com/pummelco"><span class="image img_assist_view"><img src="/image/view/809/thumbnail" width="?" height="?" alt="PummelCo: CD-ROM Design" title="PummelCo: CD-ROM Design" /></span></a><div class="caption" style="width: ?px;"><strong>PummelCo: </strong>CD-ROM Design</div></div>Notice the question marks. If the size were hardcoded, and then you couldn't change the sitewide thumbnail size without messing up existing pages.
The only advantage I can see for using straight HTML is independence of img_assist. Other than that, I think everything you want can be added to the existing version of img_assist. I don't think it's worth changing the existing version to use HTML instead. It would cause the problems I described above and it would really limit theming.
TinyMCE Changes image link
I am not sure if this is a related problem , but I can create page content using "full html" input format, and include an image using img_assist without problem and the image is visable
I then edit the page using tinyMCE and the image is no longer visable. Viewing the page as HTML the link ref has been changed
Img_Assist:
img src="?q=system/files&file=images/tree.jpgtinyMCE:
src="/?=system/files&file=images/tree.jpg"inserting "/" at the start of the path, and replacing the ampersand with the HTML character entity
"&"I am sure this is a problem with input format filtering. I have created a new input format,with all filters disbabled (as described in the release notes) but the problem persists.
How can I fix this ? Does anyone have an input format or configuration which works. Any help would be appreciated.
Thanks
Dave T
Are you using this rewritten version of img_assist?
Are you using this rewritten version of img_assist? If you are using tags as generated by the original img_assist they may be getting rewritten by TinyMCE. TinyMCE filters your code for tags, attributes, and URLs it doesn't understand. This is separate from the Drupal filter system. There are easy ways to add support to new tags and attributes, but I don't know how to disable URL checking.
The best solution is to start using img_assist filter tags [img_assist|nid=123|...]. If you use this version of img_assist you can't insert tags. The upcoming 4.7 version will use tags only for textareas that are not input format aware (e.g. are not processed by the Drupal filter system).
Besides the same name and
Please correct me if I am wrong, but doesn't the official img_assist fail to provide any option for aligning images? And isn't this one big feature of your module?
I am looking to install your
I am looking to install your img_assist and tinymce modules on a 4.6 site for the final time. Could you please clarify a few questions for me?
http://drupal.org/node/32506#comment-67077
Is the image for the properties page a temporary one? Also, when you say, "this img_assist module creates its own image to display on a node", do you mean that it creates a separate one or just that it actually does it through the image module? If the former, aren't there two nodes of the same image to deal with?
Does the latest version of your module address this issue?
In my image module settings, the thumbnails are 100x100. Should I leave this setting alone or should I change this to 200x200 to match your module?
Is this (different derivatives) still the case with the updated version of your module
Regarding the tinymce.module you provide, how close is it to the drupal tinymce.module and does it provide all the changes (not the version jumps from 4.6 to 4.7 etc, but the bug fixes, updates) of the official (drupal) module? I mean, it is quite unreasonable to expect you to provide constantly updated versions of the module.
Is the image for the
This version of img_assist does create it's own image derivatives, and they are not temporary (they could be, I just haven't written a cron hook to do it). However, this does not create a second node. Img_assist works with image.module to manage images.
No, not yet. However, I plan to start putting a lot of time into img_assist again to get it ready for 4.7.
This is why my module creates it's own derivative for the properties page... so you don't have to change your thumbnail size. You can keep your thumbnails as small as you like, but the image shown in the properties window should always be big enough to see because it's currently hardcoded to 200x200 (this is the outer boundar -- the aspect ratio is always kept).