• New configuration option "Maximum resolution to uploaded image": Resize original uploaded image if greater than specified size. It reduces disk space in server, reescaling hipersized uploaded images.
  • Setup checks the module dependencies (upload).
  • Images directory is relative to drupal system file_directory_path().
  • Set description to filename of uploaded image when no description typed by user.
  • Add sequence numbers to filename when repeated. Useful when upload files from cameras with same filename.
  • Filenames generates from MD5 are 8 chars + ext.
  • File name extension lowercased.
CommentFileSizeAuthor
node_images-070519.patch8.27 KBcaligari

Comments

Vallenwood’s picture

Caligari, thank you for implementing some good ideas. However, I've noticed some problems with this code and have to say I don't recommend anyone install this patch unless they're addressed.

  1. The module-dependency thing has already been fixed in the latest module version, so that one's just unnecessary now (but great catch in spotting it).
  2. The "description" field for your new 'node_images_resize_original' parameter is badly spelled and a little confusing in its wording. English may not be your first language, so I recommend you say: "Resize original uploaded image to these maximum dimensions, if image exceeds them. Reduces server disk space usage. Aspect ratio is maintained. The size expressed as WIDTHxHEIGHT (e.g. 640x480). Leave blank if you do not wish to resize uploaded node images."
  3. If you're going to make the upload directory relative to the "files" directory, you HAVE to say so in the description field when people are on the Node Images admin screen. There is no updated text saying so. For example, if you go into Site configuration > Image in a typical Drupal site, you will see "Subdirectory in the directory "files" where pictures will be stored" underneath the path textfield, making it perfectly clear that this is what is occuring. In any case, I'm not sure this is a good idea anyway, since any future patchers might call the 'node_images_path' and not know that you've changed it.
  4. Lastly and most importantly, it is VERY badly-behaved code to rename a core module function. Your code renames the entire _node_images_create_thumbnail function, replacing it with your proprietary _node_images_resize function. This is an incredibly bad idea--future module versions will expect it to be there, plus other patches may depend on it (such as Re-resizing node images and Highly Enhanced Thumbnail generation)! It's totally unnecessary, too; all you needed to do was use your new resize function to handle the uploaded image but still call the existing thumbnail function for creating the thumbnail.

IMHO, I think if you addressed these problems, this patch would be just great and worth including in future module versions.

caligari’s picture

Yes, I am Spanish native. My apologies O:-)

OK all your comments. I patched node_images module to my site in urgent case: avoltascoscontos.com. Please, feel free to take the usable code you need :)

hgmichna’s picture

Thanks for this very useful module!

Is the auto-resizing of uploaded pictures already contained in the current development version 5.x-1.x-dev of 2007-Jun-19? If not, when can we all hope to get a reasonably stable version with it?

Hans-Georg

hgmichna’s picture

Hm, no reply. Are we riding a dead horse?

Caligari, if you ever read this, are you still committed to improving your module and making new versions available?

If so, which of the points mentioned above by Vallenwood can you address or have you addressed or will you make available?

If not, would you consider asking somebody else to maintain and improve it? Not knowing PHP, I can't do it, unfortunately, but perhaps somebody else wouldn't mind.

What I find very difficult to understand is that we have a patch of 2007-05-19 that purports to have automatic image resize, but the 5.x-1.x-dev version of one month later, 2007-06-19, doesn't have automatic image resize. Could you or could anybody please explain that?

I'm grateful for the module, which, I think, does exactly what many Drupal operators need, but I'd be less grateful for being led down a dead alley. Hope that's not the case here.

Hans-Georg

heronog’s picture

I would love to take over this module, or at least contribute to integrate all the patches. I don´t know how long it would take, but I am willing to give it a try...

If caligari is still around: Great job man!!! This is a great and much needed module. I ditched image galleries after I found your module.

Anyway, I´ll try to get this rolling today.

thanks!

stefano73’s picture

heronog, can you try the patch attached to this comment? I asked for feedback before appying it to head. It includes also caligari's features.

heronog’s picture

2 things.... I just noticed caligari is not the owner of the module (great job with the patch anyway!! and kudos to the author)

and second thing, I didn´t mean to be rude asking to take over the module, I just got confused with the previous comment. Anyway, I would love to help to make this THE best module for images in drupal....

Now I feel better.

Thanks

heronog’s picture

@stefano73

I´m on it right now, patched the 5.x-1.x-dev and it works....

how can I checout the svn? to get the HEAD version, I am too lazy to download each file :D

stefano73’s picture

Updated HEAD and 5.x branch. Thanks everyone for submitting patches and ideas.
@heronog, you can download files from the drupal repository using CVS tools like TortoiseCVS. Take a look at this page to learn more.

hgmichna’s picture

Great news and I'm very sorry for my totally wrong assumption that the module's author was caligari.

stefano73, how about creating a new 5.x-1.x-dev version or even a new stable version? Otherwise many users would be forced to dive into the vagaries of the repository. I think I once used it through some web interface, but a simple download from the project page would be so much nicer.

I also think that Node Images is the best image handler far and wide for most normal requirements. My message was triggered by the fear of it getting neglected. I'm very happy that that is not the case. Thanks!

Hans-Georg

heronog’s picture

@ hgmichna: Hands down, the best image handling module. I am guessing this approach is not very "drupal style" specially with the "everything is a node" stuff, but for practical purposes, this is the best way to do it... or at least the easier to understand for me.

@stefano73 - The patch is Working For Me(tm). But I lost the thickbox integration :(

I have been working on some other display styles for the images, right now I have a thumbnail carousel with the image showing below the carousel when you hover the thumbnail.... I´ll post a link as soon as the site is online, so you can check it out and integrate it in case you like it.

hgmichna’s picture

I downloaded the two fresh files from the repository web interface, which isn't actually that difficult, disabled the module, and replaced the two old files. Then I re-enabled the module and haven't seen any problems so far. The image resizing works very well.

I'll report here if I find any issues. In other words, no message—no problem. Have it running on two sites, most prevalently on http://elephanttrust.net/.

Hans-Georg

stefano73’s picture

Status: Needs review » Closed (fixed)