Thread Locked This thread is locked - replies are not allowed.



Permlink Replies: 356 - Pages: 24 [ Previous | 1 ... 6 7 8 9 10 11 12 | Next ] - Last Post: 18-Nov-2017 16:56 Last Post By: davidekholm Threads: [ Previous | Next ]
davidekholm

Posts: 3,683
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 11:51   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:

Please give the code and the skinfile name which explains me how I can indicate that separate theme images are supported. I can't drag a theme image now to the Theme image box on the folder panel.

See my earlier post. Just add
separateThemeImage=true
to the skin.properties file. Your skin also needs to provide that folderImageSize variable (a String containing a dimension specification, for instance "1000 x 300") but you already do that I understand.
AndreWolff

Posts: 1,886
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 11:56   in response to: davidekholm in response to: davidekholm
Yes, thanks, you was too quickly I was just editting my last message:

Edit:
Ok I did find a solution by putting
separateThemeImage=true
in the skin.properties file.

But I have still no idea how to handle the "folderImageSize" variable.
AndreWolff

Posts: 1,886
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 11:58   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
Your skin also needs to provide that folderImageSize variable (a Dimension object) but you already do that I understand.
No I don't do that.
Edit:
Is there any skin where I can see how a Theme image is handled?
I my current skins I have a theme image, but that is handled without any core variable.

Edited by: AndreWolff on 02-Nov-2017 11:58
davidekholm

Posts: 3,683
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:02   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
Yes, thanks, you was to quickly I was just editting my last message:

Edit:
Ok I did find a solution by putting
separateThemeImage=true
in the skin.properties file.

But I have still no idea how to handle the "folderImageSize" variable.


Add an (invisible if you want) UI text field component to your onload file, or straight inside SkinModel, like this:
(SkinModel):
public String folderImageSize="1000 x 300";
Or in onload.bsh:
// Within a ControlPanel
public JTextField folderImageSize = new JTextField("1000 x 300");

That shoud be enough. I'm personally not 100% satisfied with this approach as it's not explicit (you have to know what technique to use instead of just reading a JavaDoc API), but It's how it currently works in Turtle and Tiger. I'll probably come up with an alternative to this that is more explicit, but keep support for this for backwards compatibility.
davidekholm

Posts: 3,683
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:04   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
Is there any skin where I can see how a Theme image is handled?

You can look at the source code for Turtle. Note though that I plan to manage the creation of theme images within jAlbum's core soon, so you don't have to manually scale, crop and generate JPEGs for them.
AndreWolff

Posts: 1,886
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:06   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
AndreWolff wrote:
Yes, thanks, you was to quickly I was just editting my last message:

Edit:
Ok I did find a solution by putting
separateThemeImage=true
in the skin.properties file.

But I have still no idea how to handle the "folderImageSize" variable.

Add an (invisible if you want) UI text field component to your onload file, or straight inside SkinModel, like this:
(SkinModel):

public String folderImageSize="1000 x 300";
Or in onload.bsh:
// Within a ControlPanel
public JTextField folderImageSize = new JTextField("1000 x 300");

That shoud be enough. I'm personally not 100% satisfied with this approach as it's not explicit (you have to know what technique to use instead of just reading a JavaDoc API), but It's how it currently works in Turtle and Tiger. I'll probably come up with an alternative to this that is more explicit, but keep support for this for backwards compatibility.
OK Thanks again.

I use no skinmodel file, so I will put it in onload.bsh.

But I do define the dimensions already in the skin (in %), I only need the path.

How can I get the path of the selected theme image?

Edited by: AndreWolff on 02-Nov-2017 12:07
davidekholm

Posts: 3,683
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:09   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:

How can I get the path of the selected theme image?

As posted above
path = currentFolder.getProperties().get("themeImagePath");
AlbumObject theme = currentFolder.getChild(path);
Note that this gives you the path to the AlbumObject. It's then currently your responsibility to load,scale+crop and save the theme image file. I plan to provide this by the core and simply pass a jAlbum variable to the skin which contains the final path. I don't plan to change the API above though, just to do more work for you.
AndreWolff

Posts: 1,886
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:11   in response to: davidekholm in response to: davidekholm
OK, thanks, I will try it out.
But I am not sure this is going to work, because now my theme image is mostly one of the slides images or a themeimage.jpg file dropped in the output folder by hand.

Edited by: AndreWolff on 02-Nov-2017 12:13
jGromit

Posts: 7,708
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:30   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
Allow intuitive cropping of the theme image (most common error in Turtle and Tiger albums that heads are cropped in theme images). The crop focus is set by dragging straight onto the theme image selector

I'm seeing some strange behavior in Tiger. When I select the skin, the default maximum page width is 1080, and the theme image height is 240, so the folderImageSize variable is saved as 1080x240. So far, so good.

If I change the maximum page width to 1560, the crop mask in the folder properties panel doesn't change. If I save the project, the folderImageSize variable is now 1600x240 (?). The crop mask changes only if I close and re-open the project.

Now if I change the maximum page width back to 1080, nothing ever changes again. The folderImageSize variable remains stubbornly at 1600x240, no matter what I do.

Beyond that, there's an inherent problem here, and I don't know how to address it. In a responsive skin, the theme image size will depend upon the width of the viewport. At album creation time, one can't know what its displayed dimensions will be. It's a full-width banner, so it might end up being 4000x240.

I have faced the same problem with theme images in my own skins, and the only reliable thing to do has been to feed them pre-cropped theme images, scale them to a large value like 2500x2500, and rely on the fact that the CSS keeps the background image centered as the <div> around it expands and shrinks with viewport changes.

Take a look at this page, for example, and play with the viewport width to see what I'm getting at: https://jgromit.com/gromit/overlays/

I guess I'll have to mull this over.

...by providing a "folderImageSize" variables....

This had me scratching my head for a bit. Really, David?! Not themeImageSize?
jGromit

Posts: 7,708
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:39   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
You can look at the source code for Turtle.

No, actually you can't. The only thing that's visible in Turtle is the determination of the target dimensions of the folderImage, in init.bsh. The actual work of scaling and cropping is apparently being done somewhere in compiled code, and is therefore invisible.
AndreWolff

Posts: 1,886
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 12:44   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
AndreWolff wrote:

How can I get the path of the selected theme image?

As posted above

path = currentFolder.getProperties().get("themeImagePath");
AlbumObject theme = currentFolder.getChild(path);
Well that does not work in my case:

I did put in index.htt:
<%
path = currentFolder.getProperties().get("themeImagePath");
AlbumObject theme = currentFolder.getChild(path);
%>
<!--  path = ${path}  theme = ${theme} -->
It crashed:
Stack trace for jAlbum 14.2b10 using skin Slide Show 4 4.2.2:
 
se.datadosen.util.ScriptException: bsh.TargetError: Sourced file: inline evaluation of: ``  path = currentFolder.getProperties().get("themeImagePath");  AlbumObject theme . . . '' : Typed variable declaration : Method Invocation currentFolder.getChild : at Line: 3 : in file: inline evaluation of: ``  path = currentFolder.getProperties().get("themeImagePath");  AlbumObject theme . . . '' : currentFolder .getChild ( path ) 
 
Target exception: java.lang.NullPointerException
 in index.htt at line number 257
	at se.datadosen.jalbum.TemplateParser.eval(TemplateParser.java:889)

This is line 257: AlbumObject theme = currentFolder.getChild(path);

Edit:
This does not help:
<%
path = currentFolder.getProperties().get("themeImagePath");
if (path != void || path != null) {
AlbumObject theme = currentFolder.getChild(path);
}
%>
<!--  path = ${path}  theme = ${theme} -->


Edit:
This works:
<%
path = currentFolder.getProperties().get("themeImagePath");
%>
<!--  path = ${path}   -->

Edited by: AndreWolff on 02-Nov-2017 13:07

Edited by: AndreWolff on 02-Nov-2017 13:19

jGromit

Posts: 7,708
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 13:00   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
Let the user set the representing folder thumbnail....

I was a little puzzled not to see any crop mask on that (and for a few moments, I thought that's what folderImageSize was referring to, since this is, after all, the image that's used to represent the folder). The "Set crop focus" tool is available, of course, but that also includes the aspect ratio of the theme image, which is a bit confusing, given that the folder properties panel also has a place to set the crop focus of the theme image. Who's in charge?
jGromit

Posts: 7,708
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 13:28   in response to: jGromit in response to: jGromit
One little UI oddity. There's one place where a JComboBox has odd controls. See screenshot.

Edit: Also weird on macOS. Here, with default L&F, but other L&F's are also strange.

EditEdit: OK in Darcula, however!
jGromit

Posts: 7,708
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 13:30   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
The Nimbus errors should be fixed if you update the beta core file.

Yes, that seems to have done the trick for the real problems (missing stuff, console errors). Menu location is a minor issue.
davidekholm

Posts: 3,683
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 02-Nov-2017 13:38   in response to: jGromit in response to: jGromit
jGromit wrote:

Perhaps Laza can comment on those stuck sizes.

This had me scratching my head for a bit. Really, David?! Not themeImageSize?

I know (blush). The "folderImageSize" is for Turtle compatibility. If you want to use themeImageSize instead, set the skin property themeImageSizeName=themeImageSize.
Legend
Forum admins
Helpful Answer
Correct Answer

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