|
Replies:
14
-
Pages:
1
-
Last Post:
18 Jan 19, 22:34
Last Post By: drmikey
|
|
|
Posts:
208
Registered:
22-Dec-2006
|
|
|
adding isUseThumbForFolderIcon to json data
Posted:
4 Apr 18, 20:28
|
|
|
Not sure this is possible but when I add: {
"paging": 0,
"include": [
"isUseThumbForFolderIcon"
]
}
to data-config.json or jm = new JSONMaker(engine);
jm.setIncludes(new String[] { "isUseThumbForFolderIcon" });
dataTree = jm.getTreeAsString(rootFolder);
to init.bsh, isUseThumbForFolderIcon is not included in the json output. Is this not an option to include?
|
|
|
Posts:
3,815
Registered:
4-Aug-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
4 Apr 18, 20:41
in response to: drmikey
|
|
|
Maybe you need engine.isUseThumbForFolderIcon()
|
|
|
Posts:
208
Registered:
22-Dec-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
4 Apr 18, 20:47
in response to: RobM
|
|
|
Thanks for the suggestion. No Jalbum error using this but no output in the json file.
jm = new JSONMaker(engine);
jm.setIncludes(new String[] { " engine.isUseThumbForFolderIcon()" });
dataTree = jm.getTreeAsString(rootFolder);
|
|
|
Posts:
3,815
Registered:
4-Aug-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
4 Apr 18, 20:51
in response to: drmikey
|
|
|
If you are trying to get the value for an individual file, rather than the general setting for the project, it is not so easy.
Edited by: RobM on 18-Jan-2019 21:33
Removed deleted link
|
|
|
Posts:
3,815
Registered:
4-Aug-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
4 Apr 18, 23:23
in response to: RobM
|
|
|
Unsure what you are really after, but maybe you could include both iconPath and thumbPath, then test if iconPath exists for a specific album object?
|
|
|
Posts:
208
Registered:
22-Dec-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
4 Apr 18, 23:42
in response to: RobM
|
|
|
It's related to a skin I have that uses json in a handlebars template and it's a problem getting the generic folder thumb (long story related to template coding and thumb paths). I could solve it with an if -- else statement in the template related to isUseThumbForFolderIcon being true or false.
|
|
|
Posts:
3,442
Registered:
18-Oct-2002
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
5 Apr 18, 17:04
in response to: drmikey
|
|
|
engine.isUseThumbForFolderIcon() is a global setting, not something image specific. Why do you want that stuffed inside the JSON data tree?
The includes mechanism only looks at image-specific variables.
To make the JSON file generation more flexible, I plan to allow skin developers to inject arbitrary data into each node. It could look like this (Java example, but similar can be done through JavaScript): dpm = new JSONMaker(engine);
dpm.forEach((ao, obj) -> {
if (ao.isHidden()) {
obj.put("hidden", Boolean.TRUE);
}
});
|
|
|
Posts:
208
Registered:
22-Dec-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 18:51
in response to: davidekholm
|
|
|
Another question about this ( hopefully not too confusing)
With the fact that engine.isUseThumbForFolderIcon() is a global setting, if this value is false (i.e., "Use thumbnail for folder icons" is unchecked under advanced) but an individual folder setting still has the checkbox "❤️ Use as folder thumbnail" checked, the generic folder.png width and height is set to the image that has the ❤️, not to the width and height of the actual folder.png. (I am setting the height and width using thumb.width and thumb.height from the json file). Shouldn't setting the global value override the ❤️ checkbox?
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 18:56
in response to: drmikey
|
|
|
Shouldn't setting the global value override the ❤️ checkbox?
Not really following all of this, but I think you have this backwards. If you check the global Use thumbnail for folder icon, jAlbum automatically selects the first image in the folder. If you don't check that, no image is automatically selected.
In either case, if you explicitly mark one of the images with Use as folder thumbnail, that's what it does. Image-specific always overrides global.
|
|
|
Posts:
208
Registered:
22-Dec-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 19:03
in response to: JeffTucker
|
|
|
Thanks, I am kind of a backwards guy...
Must be the way my javascript handles the json data in my template, independently of Jalbum's settings.
So what is the variable name for the image specific setting?
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 19:17
in response to: drmikey
|
|
|
There really isn't a variable. If an image has been chosen to represent the folder, then iconPath is void, and thumbPath points to the thumbnail of that image. The thumbWidth and thumbHeight variables should then also be the actual dimensions of the thumbnail, rather than the dimensions of the folder icon.
|
|
|
Posts:
208
Registered:
22-Dec-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 19:25
in response to: JeffTucker
|
|
|
And iconPath has no height or width set if it is not void, at least what I can see in the json data.
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 19:29
in response to: drmikey
|
|
|
If iconPath exists, there should be a thumbWidth and thumbHeight. Take a look at the index.htt of Minimal, at line 41 - it's calling those variables to do the HTML layout.
I can't speak to what JSON provides. I don't do JSON. Does it have something to do with the Argonauts?
|
|
|
Posts:
8,039
Registered:
31-Jan-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 19:37
in response to: JeffTucker
|
|
|
Just did a quick, simple test with Minimal - just a couple of images, and a folder with no representing thumbnail. What I see in data1.json looks like this: thumb
path "res/folder.png"
width 124
height 124
Looks like dimensions, to me. The actual folder.png is 128x128, but the default thumbnail bounds are 124x124, so that's the size it's reporting.
And if I set the thumbnail bounds to 180x180, the dimensions of folder.png are reported as 128x128, as they should be (it won't make folder.png bigger than it really is).
|
|
|
Posts:
208
Registered:
22-Dec-2006
|
|
|
Re: adding isUseThumbForFolderIcon to json data
Posted:
8 Apr 18, 19:45
in response to: JeffTucker
|
|
|
Thanks for the help. (The Argonauts thank you also).
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|