This patch provides thumbnail generation to imagefield.
Allow thumbnails size configuration on imagefield configuration page, and provides two thumbnail related components in node object imagefield arrays:
- [thumbnailpath]: path to the thumbnail image
- [view_thumbnail]: generated html for the thumbnail. Override it using theme_imagefield_image_thumbnail
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | imagefield_5.1-thumb_1.patch | 10.33 KB | nacho.mg |
| imagefield.module-5.1_thumb.patch | 5.06 KB | nacho.mg |
Comments
Comment #1
nacho.mg commentedComment #2
nacho.mg commentedComment #3
nacho.mg commentedComment #4
nacho.mg commentedComment #5
twiik commentedIt's working good, but I can't seem to change the thumbnails sizes. It's max 120x120 no matter what I do. And I can't find where the max resolutions are stored.
Comment #6
erlendstromsvik commentedLine 10 in the patch file is wrong:
You can't get widget parameters with variable_get().
Change the line to:
Comment #7
nacho.mg commentedTotally right! Here's the patch fixed.
Comment #8
dopry commentedI did a quick once over on the code... I'm moving this to head, which is technically 5--2, I haven't made a dev release of it... I'd love to see this feature in it!! I'm recovering from a curmudgeonly phase. :)
It does needs some work still.
1) thumb_path needs to be added to the database columns, eliminating it from hook_field op=load. We need to save the path in the database at the time of thumbnail creation/image upload.
2) need to be able to configure base thumb path same as image path with token support. see the token support implementation for image_path. I would like to see the $item->thumbnailpath = tokenized($thumbpath) . tokenized($imagepath).
3) _thumbnailname needs to be imagefield_thumbnailname to keep the function in the proper namespace for the module. Adhering to your namespace is very important in Drupal, especially with many modules competing for namespace.
4) reroll against DRUPAL-5--2 branch of imagefield.
If you get the patch done. I'll get the update function.
Awesome work by the way.
--dopry
Comment #9
jpetso commentedEither this issue or #152370: Thumbnail support is a duplicate. Could a maintainer please decide on one of those and close the other?
Comment #10
CoolDreamZ commentedSubscribing as this is an important issue - displaying the full size images in the edit node page is a serious performance hit.
Comment #11
dopry commented@trasgu: can you explain to me how this patch handles thumbnails created if the image is not save... say the user never submits the node and the original file is never really saved? I don't want to be leaving dangling thumbnails around... and I'm having braindead morning. Are you gonna get a chance to update the patch?
Comment #12
nacho.mg commentedSorry, I was little offside. Let me recover this patch and think about it ;-)
Comment #13
MPiccinato commentedI am willing to support this fix financially if needed to get it done ASAP and committed to the HEAD.
Comment #14
ChristieLuv commentedHi! This looks like a great patch! I haven't patched a file before, can you show me instructions on how to patch the file or just attach the already patched file? Thank you so much!
Comment #15
ChristieLuv commentedOh nevermind, I found out how to do it with this page:
http://drupal.org/node/101748
The instruction are pretty much the same with the latest v5. Thank you so much though!
Comment #16
thepanz commentedIMHO this feature don't have to build it into imagefield, let Imagecache ( http://drupal.org/project/imagecache ) do it's (fine) work. Maybe Imagecache and Imagefield can merge, or Imagecache have to add support for "Default" image..
Regards..
Comment #17
quicksketchWe've had thumbnail support in the 6 version for a while now. Please open a new issue for any enhancements to the current approach.