LJ::img — Returns an HTML <img> or <input> tag to an named image code, which each site may define with a different image file with its own dimensions. This prevents hard-coding filenames & sizes into the source. The real image data is stored in LJ::Img, which has default values provided in cgi-bin/imageconf.pl but can be overridden in etc/ljconfig.pl.


LJ::img(imagecode, type, attrs);


  • imagecode. The unique string key to reference the image. Not a filename, but the purpose or location of the image.

  • type. By default, the tag returned is an <img> tag, but if 'type' is "input", then an input tag is returned.

  • attrs. Optional hashref of other attributes. If this isn't a hashref, then it's assumed to be a scalar for the 'name' attribute for input controls.