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



Permlink Replies: 356 - Pages: 24 [ Previous | 1 ... 15 16 17 18 19 20 21 | Next ] - Last Post: 18-Nov-2017 16:56 Last Post By: davidekholm Threads: [ Previous | Next ]
davidekholm

Posts: 21,496
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 10-Nov-2017 18:15   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
davidekholm wrote:
AndreWolff wrote:
Thanks, but your original code is not working at my place, with version 14.2b10 I get error:
Typed variable declaration : Error in method invocation: Method getThemeImageDim() not found in class'se.datadosen.jalbum.AlbumBean' 
But I can't find a description of function setThemeDim() or SkinProperty "themeImageSizeName".

See http://jalbum.net/api

That gives no description of setThemeDim
See here
AndreWolff

Posts: 2,153
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 10-Nov-2017 18:31   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
AndreWolff wrote:
davidekholm wrote:
AndreWolff wrote:
Thanks, but your original code is not working at my place, with version 14.2b10 I get error:
Typed variable declaration : Error in method invocation: Method getThemeImageDim() not found in class'se.datadosen.jalbum.AlbumBean' 
But I can't find a description of function setThemeDim() or SkinProperty "themeImageSizeName".

See http://jalbum.net/api

That gives no description of setThemeDim
See here
This gives no description of themeImageSizeName

And why do I get a crash with:
engine.setThemeImageDim(maxImageWidth,maxImageHeight/3);
?
ctwist

Posts: 1,413
Registered: 27-Sep-2003
Re: jAlbum 14.2 beta for testing
Posted: 10-Nov-2017 18:39   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
And why do I get a crash with:
engine.setThemeImageDim(maxImageWidth,maxImageHeight/3);
This method requires a parameter that is a Dimension, something like
engine.setThemeImageDim(new Dimension(maxImageWidth,(int)maxImageHeight/3))
AndreWolff

Posts: 2,153
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 10-Nov-2017 19:12   in response to: ctwist in response to: ctwist
Attachment folderimage.jpg (44,2 KB)
Attachment FolderPanel.PNG (56,8 KB)
ctwist wrote:
This method requires a parameter that is a Dimension, something like
engine.setThemeImageDim(new Dimension(maxImageWidth,(int)maxImageHeight/3))
Yes indeed, that removes the error message, thanks!

But it does not solve the crop filter problem:

I have in index.htt:
folderImageSize = maxImageWidth + "x" + imgThemeHeight;
engine.setThemeImageDim(new Dimension(maxImageWidth,(int)imgThemeHeight));
where maxImageWidth=1920 and imgThemeHeight=500
This generates the attached theme image folderimage.jpg of size 1920x500, but the contents does not correspond with the theme image showed in the folder panel, see attached screenshot.

I think Davids code contains an error.

Edit:

The logger shows this output:
FINER: Initializing bsh.BshScriptEngine@b155a6c
Nov 11, 2017 2:36:05 PM se.datadosen.jalbum.EmbeddedProperties <init>
FINE: java.io.FileNotFoundException: D:\Users\Andre\Documents\Mijn websites\jalbum.net\Vecht_SaharaN\folderimage.jpg (Het systeem kan het opgegeven bestand niet vinden)
Nov 11, 2017 2:36:05 PM bsh.Reflect invokeMethod
FINE: Regenerating theme image 1920x500 for folder Vecht_SaharaN 
Nov 11, 2017 2:36:05 PM se.datadosen.util.FileFilters doLoadImage
May be the FileNotFoundException is causing the problem, but I have no idea where this debug line is generated.

Edited by: AndreWolff on 11-Nov-2017 14:36
davidekholm

Posts: 21,496
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:17   in response to: AndreWolff in response to: AndreWolff
If you open a system console and issue: JAlbumUtilities.getThemeObject(currentFolder), does that then return the wrong theme image?
AndreWolff

Posts: 2,153
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:22   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
If you open a system console and issue: JAlbumUtilities.getThemeObject(currentFolder), does that then return the wrong theme image?
No it returns
==> Vecht_Sahara_140328_1024-2.jpg

which is the image in the theme image box of the folder panel. The theme image is derived from that image.

Edited by: AndreWolff on 11-Nov-2017 18:22
davidekholm

Posts: 21,496
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:23   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
This gives no description of themeImageSizeName

That's documented here

In Java code or JavaScript code, you can refer to SkinProperties.THEME_IMAGE_SIZE_NAME
If you don't want to refer to that name via its constant but instead use a direct string, then it's themeImageSizeName (a classic capitalization to camelCase conversion)
AndreWolff

Posts: 2,153
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:28   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
AndreWolff wrote:
This gives no description of themeImageSizeName

That's documented here

In Java code or JavaScript code, you can refer to SkinProperties.THEME_IMAGE_SIZE_NAME
If you don't want to refer to that name via its constant but instead use a direct string, then it's themeImageSizeName (a classic capitalization to camelCase conversion)

I do not understand what I have to do with that.
I have in onload.bsh the line:

public JTextField folderImageSize = new JTextField("1920 x 1080");

which you did advice earlier.
I am currently not using themeImageSizeName.
If I should do that, please indicate what I should do.

I did add in file skin.prpoerties:
separateThemeImage=true

Shoulkd I add here something for themeImageSizeName?

Edited by: AndreWolff on 11-Nov-2017 18:32
davidekholm

Posts: 21,496
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:32   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
davidekholm wrote:
If you open a system console and issue: JAlbumUtilities.getThemeObject(currentFolder), does that then return the wrong theme image?
No it returns
==> Vecht_Sahara_140328_1024-2.jpg

which is the image in the theme image box of the folder panel. The theme image is derived from that image.

Edited by: AndreWolff on 11-Nov-2017 18:22


So what's wrong then? that API IS supposed to deliver the same object that you've picked in the theme image box (the box that has a crop focus selector)
AndreWolff

Posts: 2,153
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:35   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
So what's wrong then? that API IS supposed to deliver the same object that you've picked in the theme image box (the box that has a crop focus selector)
The problem is that the contens of the generated theme image is not correctly cropped, see screenshot and the corresponding theme image file.in my message above.
davidekholm

Posts: 21,496
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:36   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:
davidekholm wrote:
AndreWolff wrote:
This gives no description of themeImageSizeName

That's documented here

In Java code or JavaScript code, you can refer to SkinProperties.THEME_IMAGE_SIZE_NAME
If you don't want to refer to that name via its constant but instead use a direct string, then it's themeImageSizeName (a classic capitalization to camelCase conversion)

I do not understand what I have to do with that.
I have in onload.bsh the line:

public JTextField folderImageSize = new JTextField("1920 x 1080");

which you did advice earlier.
I am currently not using themeImageSizeName.
If I should do that, please indicate what I should do.


You don't need to use the themeImageSizeName skin property. Use it only if you don't want to be forced to use the name "folderImageSize" in your onload.bsh. If you for instance want to use the name themeImageSize in your onload.bsh, then add a skin property like this:
themeImageSizeName=themeImageSize
davidekholm

Posts: 21,496
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:39   in response to: AndreWolff in response to: AndreWolff
AndreWolff wrote:

The problem is that the contens of the generated theme image is not correctly cropped, see screenshot and the corresponding theme image file.in my message above.

Make sure you feed jAlbum a large-enough source image for the theme image. Also ensure you don't get any FileNotFoundExceptions when generating it. That error message is often misleading and can indicate a file permission issue. You can run jAlbum as Administrator to exclude permission issues.
AndreWolff

Posts: 2,153
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 18:46   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
Make sure you feed jAlbum a large-enough source image for the theme image. Also ensure you don't get any FileNotFoundExceptions when generating it. That error message is often misleading and can indicate a file permission issue. You can run jAlbum as Administrator to exclude permission issues.

The original file is 7 MB and size 8318x2845, that should be sufficient I guess.

I get indeed a file except message as you can see in the logfile displayed above, but as I said above, I don't know where that is generated.
I don't think there is a file permission problem, because a theme image is generated, just the contents is wrong. I think there goes something wrong with your crop function.

Edited by: AndreWolff on 11-Nov-2017 19:00
karlmistelberger

Posts: 737
Registered: 5-Dec-2013
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 19:13   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
jAlbum 14.2 is soon to be released now. Here are the changes and fixes:
Here are installers for Windows , Mac and zip for you to try. Bug reports appreciated!

When trying to add an image to an empty project by clicking the Add button v14.2b13 generates the error message below. v14.1.13 will open the file chooser as expected.
jAlbum 14.2b13 system console running BeanShell (BeanShell Engine)
This section captures debug prints sent to System.out and System.err
The top section evaluates expressions.
Press Ctrl+E to evaluate an expression. (Evaluates selected text if selection is active)
You have access to the basic jAlbum implicit objects such as engine and window
 
Sample expressions:
4*(3+2); // Basic calculations
engine.getSkin(); // Use of implicit object
for (AlbumObject ao : selectedObjects) System.out.println(ao); // Iterate over selected objects
window.messageBox("You can interact with any Java object");
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at java.desktop/java.awt.Toolkit.createImage(Unknown Source)
	at java.desktop/javax.swing.ImageIcon.<init>(Unknown Source)
	at se.datadosen.jalbum.ThumbnailFileView.getThumbnail(ThumbnailFileView.java:73)
	at se.datadosen.jalbum.ThumbnailFileView.getIcon(ThumbnailFileView.java:62)
	at java.desktop/javax.swing.JFileChooser.getIcon(Unknown Source)
	at java.desktop/sun.swing.FilePane$FileRenderer.getListCellRendererComponent(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.ScrollPaneLayout.layoutContainer(Unknown Source)
	at java.desktop/java.awt.Container.layout(Unknown Source)
	at java.desktop/java.awt.Container.doLayout(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validate(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "File chooser thread" java.lang.NullPointerException
	at java.desktop/java.awt.Toolkit.createImage(Unknown Source)
	at java.desktop/javax.swing.ImageIcon.<init>(Unknown Source)
	at se.datadosen.jalbum.ThumbnailFileView.getThumbnail(ThumbnailFileView.java:73)
	at se.datadosen.jalbum.ThumbnailFileView.getIcon(ThumbnailFileView.java:62)
	at java.desktop/javax.swing.JFileChooser.getIcon(Unknown Source)
	at java.desktop/sun.swing.FilePane$FileRenderer.getListCellRendererComponent(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.ScrollPaneLayout.layoutContainer(Unknown Source)
	at java.desktop/java.awt.Container.layout(Unknown Source)
	at java.desktop/java.awt.Container.doLayout(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validate(Unknown Source)
	at java.desktop/java.awt.Container.validateUnconditionally(Unknown Source)
	at java.desktop/java.awt.Window.pack(Unknown Source)
	at java.desktop/javax.swing.JFileChooser.createDialog(Unknown Source)
	at java.desktop/javax.swing.JFileChooser.showDialog(Unknown Source)
	at se.datadosen.component.JSwingFileChooser.showDialog(JSwingFileChooser.java:82)
	at se.datadosen.explorer.JAlbumExplorer$2$1.run(JAlbumExplorer.java:349)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at java.desktop/java.awt.Toolkit.createImage(Unknown Source)
	at java.desktop/javax.swing.ImageIcon.<init>(Unknown Source)
	at se.datadosen.jalbum.ThumbnailFileView.getThumbnail(ThumbnailFileView.java:73)
	at se.datadosen.jalbum.ThumbnailFileView.getIcon(ThumbnailFileView.java:62)
	at java.desktop/javax.swing.JFileChooser.getIcon(Unknown Source)
	at java.desktop/sun.swing.FilePane$FileRenderer.getListCellRendererComponent(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.ScrollPaneLayout.layoutContainer(Unknown Source)
	at java.desktop/java.awt.Container.layout(Unknown Source)
	at java.desktop/java.awt.Container.doLayout(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validate(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "File chooser thread" java.lang.NullPointerException
	at java.desktop/java.awt.Toolkit.createImage(Unknown Source)
	at java.desktop/javax.swing.ImageIcon.<init>(Unknown Source)
	at se.datadosen.jalbum.ThumbnailFileView.getThumbnail(ThumbnailFileView.java:73)
	at se.datadosen.jalbum.ThumbnailFileView.getIcon(ThumbnailFileView.java:62)
	at java.desktop/javax.swing.JFileChooser.getIcon(Unknown Source)
	at java.desktop/sun.swing.FilePane$FileRenderer.getListCellRendererComponent(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
	at java.desktop/javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.JComponent.getPreferredSize(Unknown Source)
	at java.desktop/javax.swing.ScrollPaneLayout.layoutContainer(Unknown Source)
	at java.desktop/java.awt.Container.layout(Unknown Source)
	at java.desktop/java.awt.Container.doLayout(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validateTree(Unknown Source)
	at java.desktop/java.awt.Container.validate(Unknown Source)
	at java.desktop/java.awt.Container.validateUnconditionally(Unknown Source)
	at java.desktop/java.awt.Window.pack(Unknown Source)
	at java.desktop/javax.swing.JFileChooser.createDialog(Unknown Source)
	at java.desktop/javax.swing.JFileChooser.showDialog(Unknown Source)
	at se.datadosen.component.JSwingFileChooser.showDialog(JSwingFileChooser.java:82)
	at se.datadosen.explorer.JAlbumExplorer$2$1.run(JAlbumExplorer.java:349)
davidekholm

Posts: 21,496
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 11-Nov-2017 20:44   in response to: karlmistelberger in response to: karlmistelberger
Karl, I'll make a handler for that error. It again seems to be a broken image. Please open Preferences->Advanced and ask jAlbum to attempt to use the native file chooser instead.
Legend
Forum admins
Helpful Answer
Correct Answer

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