Adding images to a Download

Introduction


As well as adding text to describe the contents of a Download one can also add multiple images, audio previews and video previews. 

This article deals with adding images.  See adding audio and video previews (opens ina new window/tab) for adding those types of preview.

As always the actual display of what is shown and where it is shown on the front end view is determined by the active layout.

The two layout classes that show images are 'Downloads' and the 'Download Details'.

AddImage01
In the layouts, for historic reasons, images are referred to as 'screenshots'.  After adding an image the result in the Downloads view is shown as a thumbnail like the one shown above.

Check GD Library Installed

When creating thumbnails, jDownloads requires that the PHP function GD Library has been loaded.
 If it is installed then a messageV4 gd library present is shown in the basic  settings.  If it is not installed then a messageV4 gd libray missing will be shown.  Including the GD library is part of the your website/PHP setup. It is normally included. Seek advice from your hosting service if it is missing.

Overview



When an image is added to a download then jDownloads may be set to automatically create a thumbnail picture.

For automatic creation go to V4 button options - V4 tab pics buttons tab then in section from Uploaded Images set option Create Thumbnails from uploaded Pics to Yes.

Thumbnail versions will be created automatically to the specified size.

The Aspect ratio is maintained as only the largest dimension is matched to the relevant maximum.

If you already have some thumbnails but you wish to change their size then set option 'Remake all Thumbnails' to Yes.

Then V4 button save.

After resizing jDownloads will reset the option to 'No'.
V4 thumbnail settings

The thumbnail is shown by the active Downloads or Download Details layout.

If you click on the thumbnail,as illustrated on the far right, then a Lightbox function is actioned in a separate window showing the image at full size with a darkened background.

Use the X to dismiss Lightbox.

AddImage02V4 thumbnail cherries

Note:
All Download image directories are stored in the Joomla! subdirectory: /images/jdownloads/.  By default none of these images are deleted if jDownloads is uninstalled.

Adding Images

Images may be added Automatically or Manually.  Automatic image creation may occur in certain situations as noted in the jDownloads Options section below.

Images may be added from the backend Admin or from the Frontend 'Create or Edit Upload' form.

Assuming that you wish to have thumbnails then the first step is to goto jDownloads V4 button options and select the V4 tab pics buttons tab. Scroll down until you eventually find optionV4 create thumb from uploaded pics. Ensure it is set to Yes as shown.

In backend

To add one or more images from the backend select V4 button downloads and then click on the relervant Download which is to have aa image added. Or create a new Download.
Select the V4 tab additional data Tab to get the Images section which is at the top of the righthand side Scroll down to find the Add an Image option. AddImage03
Click on the Browse button and select the image from your device.

Several images may be added if required. Here two have been added.

AddImage04
The images will be uploaded when you V4 button save or V4 button save close.  Assuming you have set option Create Thumbnails from uploaded Pics to Yes then thumbnail versions will be created automatically.

If you look at the Download again you will see that thumbnails of each image have been added.

To remove an image then 'untick' near its top left corner.  The image will be removed when you do a V4 button save or aV4 button save close.

AddImage04A
You may also view the image at full size in a separate tab or window by clicking on it.

In frontend

Adding an Image from the front end is similarly straight forward.

Either use an Upload menu item to create a new Download (see article Create Download Menu Item) or click on the edit pencil of an existing Download as shown opposite.

AddImage05
Go to V4 button user groups settings and click on the relevant user group name that is allowed to create or edit Downloads in the frontend. Select the V4 tab group creation editting settings and ensure that option 'Use Tabs in Frontend Upload Form' is set to Yes as illustrated opposite. V4 use tabs front end
Using tabs is strongly recommended.

Also in V4 tab group creation editting settings  specify the maximum number of images in a Download.

AddImage23
If the Images Tab or section does not appear it is likely that you have not 'ticked' the 'Add an Image' box in the V4 tab group creation editting settings section of the User Groups Settings for the relevant User Group. So scolldown to find the tickbox part

AddImage17A
Alternatively it could be that the user belongs to multiple User Groups and you have not 'ticked' the 'Add an Image' box in the User Group with the highest Ranking.

See articles 'An Overview of User Group Settings' and 'Which User-Group is Used?' for more information on User Groups Settings.


After clicking on the browse button you can select an image from your device.

In this example two images have been selected.

The first one is a Koala and the second one is a wobbegong, both of these are Joomla! demonstration images.

The view opposite is a Download Details view.
Note: Downloads only show the first image.

Add Image in front end18 AddImage24
The images are uploaded  and saved when you do a V4 button save or V4 button save and close.  jDownloads will optionally make and save thumbnail versions as well as saving the main images.

The view in the Downloads Details is like that on the far right above.  In the Downloads view only the first image will appear as the standard layouts are only configured for one image.

As would be expected, clicking on an image thumbnail will show the full size image in a lightbox view either in the same window or in a separate window/tab dependent upon your browser setup.

Generation from PDF files

Note this option requires the Imagmagik library to be present.  If it is then there will be a status message, in green text, "Status: ImageMagick PHP Module 'Imagick' is present.".
If it is not installed then a message, in red text, appears.  "Contact your hosting service if Imagmagik is not installed."

If the downloadable file is a pdf file and if the 'Create Thumbnails from PDF files' is set to Yes these settings will create a preview file and its thumbnail automatically.

This action may also be turned on for auto monitoring.

The preview picture and the thumbnail are generated to the sizes as specified opposite. 

jDownloads maintains the aspect ratio, that is only the relevant maximum is used.
AddImage28

How Images are Displayed - Layouts

If one looks at the main part of a Downloads layout the Image is actually displayed by a {thumbnail} place holder.  For example a fragment of a part of the "Standard Files Layout" when viewing the raw html code is shown below that is in 'code view' not 'editor' view.  
{screenshot_begin}<a href="/{screenshot}" rel="lightbox"><img src="/{thumbnail}" alt="" /></a>{screenshot_end}
To show a second image then just copy the above line and then add a 2 to make {screenshot_begin} into {screenshot_begin2} and simarly make {screenshot_end} into {screenshot_end2} as illustrated below. 
{screenshot_begin2}<a href="https://www.jdownloads.net/{screenshot}" rel="lightbox"><img src="https://www.jdownloads.net/{thumbnail}" alt="" /></a>{screenshot_end2}</div>

Obviously for yet more images add further lines but changing to 3, 4 and so on as appropriate.  The 'index' value referes to the order in which pictures were added.

For more details on editing layouts see the Layout documentation.

ColinM June 2019, modified Ocober 2020, June 2023

Print Email

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.