This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 17 - Pages: 2 [ 1 2 | Next ] - Last Post: 22 Feb 26, 15:42 Last Post By: RobM Threads: [ Previous | Next ]
EricLEdberg

Posts: 16
Registered: 6-Jan-2015
HowTo: Include non-images for download (with possible image placeholder)
Posted: 29 Jan 26, 23:12
 
  Click to reply to this thread Reply
Hello,

I am now using jAlbum to display collections of images for a subdivision support team. It includes your standard images, but they also wish to publish other non-image files, such as a .docx.

When I added a test word document as a linked image, it displayed a "word" icon, but when I clicked on it the viewer stated there was no preview, but offered a "download" icon in the header (download option provisioned).

Q: Is there a way to immediately download anytime the user "clicks" on the image?

When viewing the page listing photos in a repository, and after clicking on a specific non-supported file type, it could immediately offer it up for download rather than displaying a generic warning that "no preview available".

When cycling through a slideshow, it should show the placeholder icon for that file type (or a default) and when clicked immediately download the file. Could the More... link include a choice to choose what default placeholder icon to display if unknown?

Tried to search the manual and forum.

It would be a neat if jAlbum could list and offer as downloads other file types besides images when clicked.

Years and years ago I wrote a corporate web tool that recursively descend a file system displaying folders and files. One action was to "download" file types it could not display in-line on the web.

Later,

Eric L. Edberg
RobM

Posts: 4,092
Registered: 4-Aug-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 29 Jan 26, 23:35   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
If I include a docx file in a project I get a download just by clicking on the thumbnail image, using Chrome, Safari, Firefox and jAlbums's preview all do the same thing.

You can right click on the docx file and choose attacments>Representing image and attach a jpg of one of the docx pages, so you won't get a generic icon.

Edited by: RobM on 29 Jan 2026, 22:36
https://jalbum.net/help/en/jAlbum/Explore#Attachments
JeffTucker

Posts: 8,596
Registered: 31-Jan-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 29 Jan 26, 23:48   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Heavily skin-dependent.

And I've just discovered that my heretofore completely reliable routine for excluding unsupported object types has gotten broken somewhere along the line. Time to do some regression testing....

ETA: Bug report posted.

https://jalbum.net/forum/thread.jspa?threadID=60926
RobM

Posts: 4,092
Registered: 4-Aug-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 30 Jan 26, 00:50   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
Heavily skin-dependent.
I only checked half a dozen skins, just tried PhotoBlogger and that gives the duff message.
EricLEdberg

Posts: 16
Registered: 6-Jan-2015
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 30 Jan 26, 22:33   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I was using Brave.

Note: The behavior seems to have changed when I tested today and is not consistent.

When I first clicked on the generic "word" image placeholder, it display a preview of the word document. It was correctly formatted.

I then hit the back key and it displayed a blank white page.

I then reloaded the entire web project and clicked the image placeholder again and it displayed a blank white page.

I then did a page refresh and it showed the word document. The page was not formatted correctly as the word document. One of the images was shown on a second page out of order from the actual word document.

I'll let y'all debug for a while.

Here is the url to the on-line album:
https://edbergnet.com/VHL/VHL%20Tree%20Landscape%20Team/index.html
JeffTucker

Posts: 8,596
Registered: 31-Jan-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 30 Jan 26, 22:43   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
This is a good illustration of why my skins don't support album objects that can't actually be displayed in a browser acting alone. A browser can display images, videos, and PDF's. But there's nothing built-in to display things like Word documents, or spreadsheets.

What Tiger is doing is using the Google Docs viewer. It's a kludge - sometimes it works, sometimes it doesn't. The ability to tap into that viewer could, upon a whim by Google, vanish tomorrow. It's technically not supported - there's no API for it.

This thread might be more appropriate for the Tiger forum section, but I'll leave it here for now. Perhaps someone has a magic solution to address the fact that no browser can display things like this.
RobM

Posts: 4,092
Registered: 4-Aug-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 30 Jan 26, 22:51   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I think the best solution is to replace the docx file with a PDF.
JeffTucker

Posts: 8,596
Registered: 31-Jan-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 30 Jan 26, 22:55   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
I think the best solution is to replace the docx file with a PDF.

Yes. But it might be interesting for a skin to treat these kinds of files somewhat like web locations. The thumbnail could be primed to offer a download upon clicking (that part is easy). You'd still need to leave them out of the slideshow, since most lightbox scripts would choke instantly on them. Even producing slide pages for them (in a "slide page" skin) would be inadvisable - bad visitor experience.
phil44

Posts: 201
Registered: 18-Jun-2010
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 31 Jan 26, 12:03   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
One possible way to do this is to use Zip files to encapsulate the non-image files you want to offer for download. By proceeding in this way, there is no problem of interpretation or support of file formats to be included: it is the person who downloads the Zip files and who will open the zipped files with the software installed on their machine (for example Word). IMHO, all common operating systems are capable of opening Zip files and displaying their contents. If you want the person who downloads to be able to view the files without specific software, then PDF is the universal solution.

I tested this with Tiger, and a Zip file does appear in the album (this isn't the case with all file types; for example, GPX files don't display). When you click on the thumbnail in the album, the browser does offer to download the Zip file.

That said, I agree that delegating file downloads to the browser works, but it's not very user-friendly :( It would be a great improvement if jAlbum handled this automatically :)
RobM

Posts: 4,092
Registered: 4-Aug-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 31 Jan 26, 12:25   in response to: phil44 in response to: phil44
 
  Click to reply to this thread Reply
If I view the docx file directly in several browsers the layout is mangled. When the document is downloaded and viewed on iOS or macOS, preview and Pages apps, I get the same mangled layout and the font used is not included in the OS’.

PDF would solve this but if the target audience is Windows only then zipped docx would do the job. My own experience is most Windows users that send me files assume everyone else is on Windows and can see and edit docx files :(
JeffTucker

Posts: 8,596
Registered: 31-Jan-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 31 Jan 26, 16:06   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Install LibreOffice. It uses the OpenDocument standard, so it's cross-platform, but it can also read and write files in the MS formats like docx and xlsx.
EricLEdberg

Posts: 16
Registered: 6-Jan-2015
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 1 Feb 26, 20:51   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Originally, I did not think that the .docx would be displayed in-line by brave. My hope was that when I added non-media file types jAlbum would offer it up as a downloadable object when clicked. I'll google about this feature next.

I don't know if this feature is better handled by jAlbum core or a skin but wonder if jAlbum core could easily offer this capability for a project. In the simplest scenario, an option to: Enable Immediate Download For Unsupported Media File Types, would suffice.

In the program I wrote to recursively display a folder structure the generic fallback feature was to download file objects. This included an exception regex list of files/paths/extensions to never download for security or program needs. If the file type was not recognize as a built-in object, and was not rejected by never-download regex, it was offered up as a generic downloadable object.

$contentType = 'application/octet-stream'; // Default to binary

Determining what are supported and non-supported file types might be a maintenance nit for ever changing media file types....
JeffTucker

Posts: 8,596
Registered: 31-Jan-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 1 Feb 26, 20:56   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
The jAlbum core doesn't produce a single line of HTML, CSS, or Javascript. These kinds of features have always been the province of the skins.
EricLEdberg

Posts: 16
Registered: 6-Jan-2015
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 1 Feb 26, 22:11   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
After my previous post I started reading Tiger options and found a button option that solves 1 of the problems:

Tiger -> Options -> Lightbox -> Buttons -> Enable On Non Images

Enable On Non-images: Include a Download Button On Non Images

This solves most of the problems chatted above when including "supported" non images, such as word, excel, ppt, or other common document. It clearly presents a download placeholder.... This included changing the behavior of the word document example which did not try to display it in-line using the Google Docs viewer, but offered a direct download (preferred).

When I tried to drag a link into a test project with various file types that I may want to include many of them were not supported and the link was not created.

Is this a feature request for the Tiger skin or jAlbum or both?

Add the ability to link any file type to a project, and if unknown, default to presenting a download link. Currently, only known file types can be linked when adding media (files). Extend Tiger/jAlbum, possibly through optioning, to allow any file type to be included in the project for a default download.

Is this a fair summary?

Eric Edberg
JeffTucker

Posts: 8,596
Registered: 31-Jan-2006
Re: HowTo: Include non-images for download (with possible image placeholder)
Posted: 1 Feb 26, 22:32   in response to: EricLEdberg in response to: EricLEdberg
 
  Click to reply to this thread Reply
You can tinker with it yourself.

Head for the program directory, the system subdirectory, then open filetypes.xml and take a look at the format. Then open your config directory, open its system subdirectory, and plant your own little filetypes.xml in there. You can add a file type, though you'll have to dig up an icon to represent it. The existing icons are in the res subdirectory of the program, and there's an "unknown" type that you can tap into, at least temporarily.

I just did it with a ShortKeys data file, extension shk, and it let me add the file, and the Tiger lightbox let me download it.
<?xml version="1.0"?>
<!-- File types that JAlbum is to recognize -->
<filetypes>
	<type name="ShortKeys" icon="unknown.png">
		<ext>shk</ext>
	</type>
</filetypes
Needs a relaunch to have any effect, of course.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums