A common question is how to display images. In addition to other modules such as img_assist, you can also use
With clean URLs
<img src="http://www.example.org/image/view/##/preview" />
<img src="http://www.example.org/image/view/##/thumbnail" />
Without clean URLs
<img src="http://www.example.org/?q=image/view/##/preview" />
<img src="http://www.example.org/?q=image/view/##/thumbnail" />
If you go to admin >> settings >> image and look at the sizes, you will see a default name, preview and thumbnail. You can add and label other sizes as you choose.
If you want to link to your original image, the syntax is the same with the tag of _original.
With clean URLs
<img src="http://www.example.org/image/view/##/_original" />
<img src="http://www.example.org/?q=image/view/##/_original" />
With clean URLs it is possible to use relative paths for the image URL. For example:
<img src="/image/view/##/_original" />
So, to break it down,
sitename / image / view / image ID# / label will get you to an image suitable for use in an
<img src=""> tag. If you add additional sizes to the your image module settings, you can link to them by their label names as well.
More information on how to use img src can be found on the web.
Image Caching troubleshooting
1. Using this method of linking ( /image/view/xx/_original ) to images seems to cause the images to reload on every page load, no matter what.
2. Linking directly to the image ( /files/images/myimage.jpg ) allows proper caching behavior to occur.
After trying a bunch of different Apache caching configuration schemes this seems to work the best for this application. We chose the location directive since we run many drupal sites on one server, and this will match any attempt at loading an image from the image module on any of the sites. This is on Apache 2, and we made a separate file in the conf.d folder....
# This module needs to be loaded, but in my case it was already loaded..
# You may need to load it.
#Conditional loading would probably be smartest
# LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
# Note: not 100% sure this is necessary
# Cache images for 3 hours
Header Set Cache-Control "max-age=10800"