This question is answered.


Permlink Replies: 14 - Pages: 1 - Last Post: 15-Jan-2021 22:21 Last Post By: palthe Threads: [ Previous | Next ]
xexyl

Posts: 146
Registered: 1-Sep-2009
excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 10-Jul-2020 23:35
 
  Click to reply to this thread Reply
As per your - David's - helpful comment about how to exclude a filter from specific images I went to put it in my skin questions and tested it only to get a ClassCastException in AlbumBean.java:

An unexpected error occurred. Please see detailed description below:
 
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Set (java.lang.String and java.util.Set are in module java.base of loader 'bootstrap')
	at se.datadosen.jalbum.AlbumBean.isExcluded(AlbumBean.java:4252)
	at se.datadosen.jalbum.AlbumBean.processFilters(AlbumBean.java:4234)
	at se.datadosen.jalbum.AlbumBean$StandardImageProcessor.processImage(AlbumBean.java:6024)
	at se.datadosen.jalbum.AlbumBean$StandardImageProcessor.processImages(AlbumBean.java:5856)
	at se.datadosen.jalbum.AlbumBean$ImageProcessingTask.call(AlbumBean.java:5786)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)


More information: I had it for one image and I had only one filter ('ReflectionFilter'). I tried just 'Reflection' too and same problem.

It's not a huge problem for me but it'd be nice if it was fixed too. I've not done any other testing of excluded items but removing the variable from the image and the build works fine (which makes sense since the stacktrace suggests it's processing filters). The images before it that were filtered did not have any problems either.
davidekholm

Posts: 3,455
Registered: 18-Oct-2002
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 14-Jul-2020 00:13   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Just HOW did you add that excludedFilters variable? As a user variable? That's what I recommended, and shouldn't trigger that error. With the error you got, it looks like you added an ordinary variable/property called excludedFilters to an image by using jAlbum's API or by manually editing the .info files. You're not supposed to touch the ordinary "excludedFilters" variable/property as its managed by jAlbum's UI.
xexyl

Posts: 146
Registered: 1-Sep-2009
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 14-Jul-2020 01:02   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Okay this is what you said before:

I had to check the code for this, but there IS a way for users to exclude individual images from certain filters. A user can add an image specific user variable under the Edit view called "excludedFilters" and set the name of the filter (or filters, comma separated) as the value. Geeky, yes! :-)

So what I did is right click on an image, click 'Edit' (that is the Edit view, right?) and then did as I noted in the OP. However what you say here makes me think that there's another way. I am familiar with the User variables under Advanced -> User variables but that's not image specific is it? Or let me ask that differently: is it possible to make it image specific?

Because from:

davidekholm wrote:
Just HOW did you add that excludedFilters variable? As a user variable? That's what I recommended, and shouldn't trigger that error. With the error you got, it looks like you added an ordinary variable/property called excludedFilters to an image by using jAlbum's API or by manually editing the .info files. You're not supposed to touch the ordinary "excludedFilters" variable/property as its managed by jAlbum's UI.

I'm not actually sure now what the difference is. Anyway screenshot shows where I added it (though it's not added here it's the same place I did do).

Does that give you enough information?
davidekholm

Posts: 3,455
Registered: 18-Oct-2002
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 14-Jul-2020 12:30   in response to: xexyl in response to: xexyl
Correct
  Click to reply to this thread Reply
Sorry for this red herring. It turned out that I've broken the hack of using the "excludedFilters" user variable. Now fixed in the upcoming release. You will however need to call the user variable "excludeFilters" and not "excludedFilters".
xexyl

Posts: 146
Registered: 1-Sep-2009
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 14-Jul-2020 16:05   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
No worries.

Thanks! I'm looking forward to it.

Cheers.
xexyl

Posts: 146
Registered: 1-Sep-2009
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 19-Jul-2020 19:12   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Just confirmed that in jAlbum 21 this works fine.

Thank you again!

Cheers.
xexyl

Posts: 146
Registered: 1-Sep-2009
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 19-Jul-2020 19:13   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Sorry for duplicate, connection problem in the posting.

Anyway thanks again. Much appreciated.

Edited by: xexyl on 19-Jul-2020 10:13
davidekholm

Posts: 3,455
Registered: 18-Oct-2002
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 22-Jul-2020 00:21   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
You're welcome
palthe

Posts: 19
Registered: 27-Dec-2009
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 14-Jan-2021 16:08   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Does this mean that the method to exclude individual images from a filter as described in the article about image filters http://jalbum.net/help/en/More_about_image_filters#Logotype_filter is not correct?

Excluding an Image

You can exclude an individual image from the album-wide logotype filter by opening the image for editing in jAlbum, opening the Variables panel on the right, and entering a new variable with the name applyLogo and a value of false.

Edited by: palthe on 14-Jan-2021 16:12
RobM

Posts: 3,381
Registered: 4-Aug-2006
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 14-Jan-2021 20:49   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
The exclude filter method still works.
palthe

Posts: 19
Registered: 27-Dec-2009
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 15-Jan-2021 15:19   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Let me explain my question:

In my skin I use the FixedShapeFilter.
I wanted to exclude some images from this filter,

In the article about filters I found this method for the LogoFilter:
1) Add a new user-variable with the name applyLogo and a value of false.

So I tried to use this method for the FixedShapeFilter:
1a) Add a new user-variable with the name applyFixedShape and a value of false,
or
1b) Add a new user-variable with the name applyFixedShapeFilter and a value of false.
This did not work.

Then I found this post with a second method:
2) Add a new user-variable with the name excludeFilters and as value a comma-separated list of filter names.

So I tried to use this second method for the FixedShapeFilter:
2a) Add a new user-variable with the name excludeFilters and a value of FixedShapeFilter.
This worked!

My question is:
Did method 1) not work for the FixedShapeFilter because
I used it incorrectly, or
It only works for the LogoFilter, or
It is outdated?

My second question:
Does method 2) also works for the LogoFilter ?
If so, it might be better to mention only method 2) in the documentation, to avoid confusion.
RobM

Posts: 3,381
Registered: 4-Aug-2006
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 15-Jan-2021 15:36   in response to: palthe in response to: palthe
 
  Click to reply to this thread Reply
palthe wrote:*.
My question is:
Did method 1) not work for the FixedShapeFilter because
I used it incorrectly, or
It only works for the LogoFilter, or
It is outdated?
It only works for the logo filter.
My second question:
Does method 2) also works for the LogoFilter ?
If so, it might be better to mention only method 2) in the documentation, to avoid confusion.
The documentation states ‘ You can exclude individual images from certain filters...’
I have not tried it with the logo filter, so don’t know. If David confirms which filters can be excluded I will update the wiki to list those that work with the excludeFilters user variable.

As for only mentioning method 2, some users might want filters other than the logo one applied. For example Grayscale for all images but logo on only some.
davidekholm

Posts: 3,455
Registered: 18-Oct-2002
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 15-Jan-2021 21:17   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
The newer "excludeFilters" user variable mechanism can be used to exclude any image filter.
RobM

Posts: 3,381
Registered: 4-Aug-2006
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 15-Jan-2021 21:53   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
The newer "excludeFilters" user variable mechanism can be used to exclude any image filter.
Thanks for confirming, wiki has been updated
palthe

Posts: 19
Registered: 27-Dec-2009
Re: excludedFilters AlbumBean.java ClassCastException (String and Set)
Posted: 15-Jan-2021 22:21   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Thank you both for the replies. It's now clear to me.
Legend
Forum admins
Helpful Answer
Correct Answer

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