This question is answered.


Permlink Replies: 15 - Pages: 2 [ 1 2 | Next ] - Last Post: 02-Dec-2017 11:51 Last Post By: AndreWolff Threads: [ Previous | Next ]
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
How to get a folderthumb.jpg?
Posted: 30-Nov-2017 19:20
 
  Click to reply to this thread Reply
We have seen now that the jAlbum core does a great job to produce a theme image folderimage.jpg, but what about the other thumbnail image box on the folder panel?

Is it it also possible to let the jAlbum core create the corresponding folderthumb.jpg image?
If not, how should I create such an image?
I can’t find the information in the Folder panel API.
davidekholm

Posts: 21,773
Registered: 18-Oct-2002
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 14:34   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
We have seen now that the jAlbum core does a great job to produce a theme image folderimage.jpg, but what about the other thumbnail image box on the folder panel?

Is it it also possible to let the jAlbum core create the corresponding folderthumb.jpg image?
If not, how should I create such an image?
I can’t find the information in the Folder panel API.


The core does generate such a thumbnail for you, but it's put among the other thumbnail images of the "thumbs" folder from the folder that image originates from. The "thumbPath" variable should point to it.
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 14:41   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Attachment ThumbsFolder.PNG (492.1 KB)
davidekholm wrote:
The core does generate such a thumbnail for you, but it's put among the other thumbnail images of the "thumbs" folder from the folder that image originates from. The "thumbPath" variable should point to it.
So if I understand you well, the thumbs folder should always contain an folderthumb.jpg image?
That does not happen at my place, see attached screenshot.
davidekholm

Posts: 21,773
Registered: 18-Oct-2002
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 14:54   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
davidekholm wrote:
The core does generate such a thumbnail for you, but it's put among the other thumbnail images of the "thumbs" folder from the folder that image originates from. The "thumbPath" variable should point to it.
So if I understand you well, the thumbs folder should always contain an folderthumb.jpg image?
That does not happen at my place, see attached screenshot.

In case of folderthumbs, they retain their original file name, and yes, they are created if even if that image is excluded.
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 15:02   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
In case of folderthumbs, they retain their original file name, and yes, they are created if even if that image is excluded.
OK, thanks for your help!

If I am the only guy who did not know this, it is not required to add this information to the Folder panel API!
davidekholm

Posts: 21,773
Registered: 18-Oct-2002
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 15:06   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
davidekholm wrote:
In case of folderthumbs, they retain their original file name, and yes, they are created if even if that image is excluded.
OK, thanks for your help!

If I am the only guy who did not know this, it is not required to add this information to the Folder panel API!


Hard to tell :-). The "thumbPath" variable has been around since day 1 and points to the representing thumbnail for folders too.
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 17:06   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Hard to tell :-). The "thumbPath" variable has been around since day 1 and points to the representing thumbnail for folders too.
Well, may be there is today a problem with the "thumbPath" variable, I have this code at the start of index.htt:
<% 
String albumImagePath = thumbPath;
%>
and I get this message:

Typed variable declaration : Void initializer. : at Line: 20
: in file: inline evaluation of: `` // Index page file index.htt // "Slide Show 4" Derived from Slide Show . . . '' : albumImagePath = thumbPath
in index.htt at line number 20

Edit:
To investgate this, I did add in index.htt this debug code:
<!-- thumbPath= ${thumbPath} iconPath = ${iconPath} -->

and this showed in index.htm:
<!-- thumbPath=  iconPath =  -->


Edited by: AndreWolff on 01-Dec-2017 17:35
davidekholm

Posts: 21,773
Registered: 18-Oct-2002
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 18:31   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
thumbPath is only available as you iterate objects, not at the top of index.htt.
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 20:09   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
thumbPath is only available as you iterate objects, not at the top of index.htt.
Well that is not said in the variable page!

You know how to make things complicated!

I need that image in the header for sharing an album on Facebook via next meta tag:

<meta property="og:image" content="https://andrewolff.jalbum.net/Vecht_Beerze/albumimage.jpg">

So I should do an iterartion in page-header.inc?
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 20:46   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Unusable solution
davidekholm

Posts: 21,773
Registered: 18-Oct-2002
Re: How to get a folderthumb.jpg?
Posted: 01-Dec-2017 20:59   in response to: AndreWolff in response to: AndreWolff
Correct
  Click to reply to this thread Reply
AndreWolff wrote:

You know how to make things complicated!

Flattering me won't get you anywhere ;-)

Try
<%= IO.urlEncode(rootFolder.getThumbnailPath()) %>
in index.htt. That provides the encoded path to the thumbnail that represents the album.
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
Re: How to get a folderthumb.jpg?
Posted: 02-Dec-2017 10:54   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Try
<%= IO.urlEncode(rootFolder.getThumbnailPath()) %>
in index.htt. That provides the encoded path to the thumbnail that represents the album.
Yes that works, Thanks!

But why don’t you set in the core:
thumbPath= rootFolder.getThumbnailPath()
?
davidekholm

Posts: 21,773
Registered: 18-Oct-2002
Re: How to get a folderthumb.jpg?
Posted: 02-Dec-2017 11:38   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:

But why don’t you set in the core:
thumbPath= rootFolder.getThumbnailPath()
?

That's a long story to explain (variable scopes and visibility). Changing the visibility of that variable so the current folder's thumbPath is also visible in index.htt could break compatibility with skins.
AndreWolff

Posts: 2,432
Registered: 14-Dec-2007
Re: How to get a folderthumb.jpg?
Posted: 02-Dec-2017 11:42   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
That's a long story to explain (variable scopes and visibility). Changing the visibility of that variable so the current folder's thumbPath is also visible in index.htt could break compatibility with skins.
OK I do understand that, but what about a new variable
folderThumb= rootFolder.getThumbnailPath()

Anyhow I think you should add this information to the Variables page!
davidekholm

Posts: 21,773
Registered: 18-Oct-2002
Re: How to get a folderthumb.jpg?
Posted: 02-Dec-2017 11:45   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
Introducing a new variable is far less risky, but there is a point in being a bit conservative with introducing new variables. I haven't heard any requests for this from any other developers.
Legend
Forum admins
Helpful Answer
Correct Answer

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