Page 1 of 1

extracting "Title" from Image Title for SlideShow

Posted: Tue Jul 17, 2018 7:26 am
by rogerl
Currently using Fancybox as a Slideshow Lightbox and have the following code in my settings:

Code: Select all

beforeShow : function() {
			this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '')
                                                      }
This works great if I manually insert a title in the SlideShow image list but it will not extract the actual title in the image which I have already inserted using Windows Explorer.
Can you advise what variable I should be using to capture the actual image title.

Re: extracting "Title" from Image Title for SlideShow

Posted: Tue Jul 17, 2018 7:55 am
by Pablo
As far a I know there is no easy way to get meta data from the image with JavaScript.

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 12:04 am
by rogerl
Hi Pablo,
So if we select use image folder on server for SlideShow your script does not produce "Title" from image description?

Have come across open source "Exif.js" which could be useful. No idea how to apply it but might make a good addition to your code.
https://github.com/exif-js/exif-js
Regards
Roger

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 6:05 am
by Pablo
The slideshow does not use a script to get the title.

The "Exif.js' script looks complicated just to get the title.

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 6:18 am
by rogerl
So do you extract the Image description from exif data at all?

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 6:28 am
by Pablo
This is done via the Windows API when you load the image.

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 7:05 am
by rogerl
OK, so how do I access that info for the slideshow?

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 7:17 am
by Pablo
If the info is available then it will automatically populate the 'Title' field in the slideshow properties (when you add a new image).

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 8:27 am
by rogerl
OK, so if I decide to use the other option and use an image folder on my server as in the advanced options do I still select the images for the list of images or do I leave it blank because I can't get that to work. I get:
Image

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 9:04 am
by Pablo
For the online option you do not need to add images locally.

Make sure the page extension is set to PHP.

Re: extracting "Title" from Image Title for SlideShow

Posted: Wed Jul 18, 2018 11:51 am
by rogerl
I was beginning to wonder - - Just couldn't lay my hands on the instructions. Was not a wasted exercise. Have found some interesting stuff along the way. Thanks for your patience.