Hi,

I like img_assist very much for selecting images, and acidfree to create photo albums. Since noone made a patch to integrate the 2, I tried my best to do itand I fixed some bugs along the way.

Since acidfree uses filemanager, which uses separate ID's from the image module, both ID-spaces clash and are incompatible. That's why I had to do an ugly trick and map acidfree-image objects onto regular image-objects. To do this I offset the acidfree-images's ID by 1000000 (number can be changed in the patch), which will give you trouble if you have more than about 333333 images in the image module database. (The image module has 3 entries per picture, 1 original, 1 preview and 1 thumbnail. This fact causes some bug, more on that below...)

This patch will allow you to browse through the acidfree albums hierarchy to pick the photo you want to insert. The directory pane of the img_assist popup window is extended with adropdown box to select an acidfree album.
Besides this main feature, I also added/fixed the following things:

- The code that checks if more than "img_assist_preview_count" thumbnails are to be shown counted the amount of images in the image database. This amount is 3 times as high because the database also contains the previews and thumbnails. I patched the code to only count the thumnails.
- Changed the code so the thumbnail instead of the original image is shown in the preview pane. I have a slow internet connection and I don't want to download 800KB pictures just to see a preview of them :)
- Added a "%thumb-link" variable in the "img_assist_mg_html" template so that I could insert a clickable thumbnail of the image in my blog.

Since I've never written a drupal module before (and technically, I haven't done that yet since this is only a patch), I wouldn't mind if someone could glance over it and correct errors of mine. I added a dependency on the acidfree module, but I don't know if that is enough ?

Hope you enjoy this patch!

greets,
-- Steven

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alanburke’s picture

Hi Steven
Thanks for the patch, Its just the thing I was looking for.
I was alerted to this by the author of AcidFree when I put in a feature request for this.

I'm afraid my experiences are similar to his, it doesn't quite work, and I'm not sure why!

It recognises that acidfree is installed and shows it as an option inthe dropdown box.
It lists any albums that are in acidfree.

However, only one of the images shows as available. Interestingly, this was uploaded Before I installed the patch for img_assist.

So There you go!
Any ideas on how I could rectify this.
Is is a settings thing? My coding skills won't be up to date for some time yet!

alanburke’s picture

Ok Now it get interesting.

The images are slowly starting to appear.
It seems that it takes a day or so, and then they show up in the Img_assist pop-up.

I don't know what this means, but it might help you!

Regards
Alan

phildu’s picture

i have a problem whit this patch

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home2/c/cx-rousse/www/cvs/modules/img_assist/img_assist.module on line 283

why ?

deepstar’s picture

Hello,

I'm sorry for the very very late reply, but my laptop with all my work has been stolen in the meantime and it set me back quite a while.

I've discovered a bug in my patch which would not display some pictures (I've only recently started to upload massive (+3GB) amounts of pictures to drupal and using them)
The bug is in the SQL query, I include a new patch.

alanburke: this patch might solve your problem maybe ?
phildu: did you apply the patch to the CVS version of img_assist ? The patch is meant for the 4.6.0 version of img_assist.

greets,
-- Steven

phildu’s picture

sorry but i have the same problem with this patch
maybe because i'm on a macintosh ?
could you send me the complete module ??

deepstar’s picture

FileSize
39.48 KB

Hi,

this is the full module I use in my 4.6 installation

greets,
-- Steven

phildu’s picture

thank , its ok

do you plant to make it for the 4.7 ???

deepstar’s picture

Right now I'm still on 4.6
When I move to 4.7 I would very much like the same functionality and if it doesn't exist yet, I will sure create it.

But, I was thinking:

Right now there is img_assist for images by the image module. I patched it to allow images from the acidfree module.
Instead of mapping acidfree objects onto image objects and tricking img_assist into believing that acidfree object are just other objects,
wouldn't it be better if there was a generic framework for adding any type of image/link through the img_assist interface ?
Besides images, you could then also add links to internal and external pages, sounds, generated content etc., all through the same handy interface.

In fact, I would love it if the interface and API described would be integrated into future versions of drupal by default. When I have some free time, I will reflect on all this for a while and see if I can make such an API that can be fitted in the drupal hooks system.

greets,
-- Steven

phildu’s picture

Category: task » bug
FileSize
407 bytes

i realize just now that i have a big bug whit the patchmodule
in fact, in many try (new clean install of 4.6.5 for example) ,
the url of the thumbail is bad .
the acidfree is ok
i attach an extract of the html of the thumbail window to help you to understand

benshell’s picture

Title: acidfree albums support + some additions and bugfixes » acidfree albums support
Version: 4.6.x-1.x-dev » 6.x-3.x-dev
Category: bug » feature

I'm the new img_assist maintainer, and I've completely rewritten img_assist for 4.7. Unfortunately that means the patches here won't work for the 4.7 version. I haven't used acidfree albums yet, but as long as images are nodes it should be easier to hack img_assist 4.7 into working with acidfree. Previous versions of img_assist worked with files using the FIDs, whereas the 4.7 version uses node IDs.

deepstar: I share your vision for a generic framework for adding any type of node (image, gallery, poll, video, sound, etc) into a post. This is definitely the next big step for img_assist. I haven't started actual work on this, but I've thought about it a lot. Please let me know if you have any more thoughts about this.

kohlerj’s picture

I need acidfree support in 4.7. Could someone explain in a bit more detail what kind of changes would be required? I've tinkered with modules before, so I'm willing to give it a shot. I just need some assistance.

patchak’s picture

Hi there,

I really need that integration as well... I'm willing to help you test patches as soon as you can have them released, I'm no programmer so i can't really code. If it's a qustion of money, benshell, I could maybe pull out $$ to get this done quickly.. Are you interested in doing it? how much time would it take?

Could someone do it please, it's a really awesome feature that's missing from this great module...

Thanks

Darren Oh’s picture

Version: 6.x-3.x-dev » 4.6.x-1.x-dev
Status: Needs review » Fixed

Fixed in CVS commit 46532.

Anonymous’s picture

Status: Fixed » Closed (fixed)