The img module is a simple but a powerful Drupal image manipulator module.

  1. You can add images to any type of nodes (story, blog, page ...).
  2. Images can be placed anywhere on the post page.
  3. You can add more than one image to posts.
  4. The thumbnail will be transformed into an image link (it will link to the owner post node).
  5. Images will keep their original attributes (title, alt ...).

What you must do?

  1. Upload an image (image.jpg) and their thumbnail (image_t.jpg).
  2. Add an image tag (or more) to your post containing the thumbnail image (<img src="/path_to_uploaded_image/image_t.jpg" alt="an image" title="My image" />).

That's all: You will see the large image only when the owner post is entirely showed.

Download and test: http://para.ro/en/node/191 (all my posts use this module)

Comments

sepeck’s picture

A little known ability of the image module is the ability to use <img src=""> tags as well.

http://drupal.org/node/47357

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

he_who_shall_not_be_named’s picture

The image module is great: It can make resized images, image galleries (but you can make galleries with img like I did: I defined a taxonomy and added stories with img content to it.).., things what img module can't do.

The image module enables thumbnails in any type of posts: books, stories, blog entries ... (and image content type made by the image.module (??!!, also ?! but no sense) and they can be placed anywhere inside the text.

So, no conflict with the image module: img.module wants to do something else than image.module does.

sepeck’s picture

I'm all good with that, just most people don't know about the img tag capabilities of the image module so I added a handbook page and thought I would mention it.

That there is some overlap of functionality is fine. You might wish to see what berkes plans are with his betterupload module as it may be that you can combine some efforts and come up with a more complete solution.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

he_who_shall_not_be_named’s picture

When your book page is ready give me a link to it, please.
I'll take a look into the upload module you talking about.

Thanks.

sepeck’s picture

You mean the link in the above comment?
http://drupal.org/node/47624#comment-89680

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

he_who_shall_not_be_named’s picture

This solution is 100% complete for users how can write img tags and/or use standalone or browser html editors.
By adding more functionality, like upload and/or re-sizer, its actual flexibility will be certainly decreased. (Before, I used the image module, but I had problems with it (slow in taxonomies, thumbnail image can't be created ....) and I decided to write an image module for my needs.)
The module is ready (again: I'm set with it) and I have no reason to keep it. So, it is in public domain now. Anyone who is interested is welcomed to do with it what he/she wants.

Cheers,
Zoli.

sepeck’s picture

It may be that your approach sparks ideas and directions or solves a problem in a way not yet thought of for others to benefit. Collaboration being usually a good thing.

By 'more complete solution', I meant berkes goal of a 'more complete solution for file handling'. Images are just another file after all with different display characteristics needed. :)

If your efforts can be combined in later generations of modules then so much the better for everyone.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

he_who_shall_not_be_named’s picture

Wow! What a discussion we had two years ago... (two years?!)

Now I am on the right way, I hope.

Cheers. :)

PG-1’s picture

Suggestions:

1) Add "Thumbnail size" and "Original image size" options to parameters.
2) Upload only original image.
3) If uploaded image don't have thumbnail size, make thumbnail using GD2 library. Otherwise use uploaded image directly as "thumbnail without original"
4) If uploaded image larger "Original image size", resize it and use resized as "original image"
5) Add "Link to original image" option to image upload panel. If it deselected, keep resized thumbnail only, and include it into text without link.
6) Keep images for every node in own node subdirectory. (It must be emptied on node deletion.)

sepeck’s picture

You are now essentially descriping the image module

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

PG-1’s picture

No.

1) Image module always create three images: original, medium and small.
2) Image module always create own node for every uploaded image.
3) Image module put all generated images to one directory.
4) Image module always made images included in text with link to original image.

Module I describe, looks like advanced version of "upload module" + "inline module".

sepeck’s picture

Then you may wish to coordinate efforts with berkes. He is working on a 'betterupload' module for more flexible handling of attachments.

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/betterupload/

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

he_who_shall_not_be_named’s picture

  1. I use this module with the upload module (it is optional). So, the images will be deleted when the owner mode is deleted. Additionally, if the site administrator sets the maximum size for uploads then the upload module will resize big images to have their size smaller than that size.í/li>
  2. In my opinion the user who made the image can easily save/upload their thumbnail too. He hasn't restricted by thumbnail size presets (because they doesn't exist).
  3. I'll include other features in this module (image browser, links to original image without node content, ....) but I'll avoid to add a built-in uploader (it already exists) and a thumbnails maker (no graphical libraries needed, then).

Thanks for your reply.

he_who_shall_not_be_named’s picture

Forgot what I said about thumbnails.

  1. I'll add a 'discover images' button to the post edit forms which, when clicked, will discover all the img tags placed into the added/changed post.
  2. For each of images discovered thumbnails and their sizes, if they exists, will be displayed.
  3. If thumbnail doesn't exist then, if user wants that, it wills be created. Their size will be suggested (values will come from the admin section) and could be changed.
  4. The 'view original image' checkbox will be added to discovered images table to change images behavior as you suggested.

I think, it will be a good, but a bit advanced, feature for the module we talking about.

Thanks again for your feedback and suggestions.

-------
http://para.ro/en

he_who_shall_not_be_named’s picture

First I'll add the 'view original image' (taxonomy level setting) and then ... I'll see.

We'll keep in touch.

he_who_shall_not_be_named’s picture

This project is removed because of the upload and inline modules. They are powerful in 4.7.

http://para.ro