This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 45 - Pages: 4 [ Previous | 1 2 3 4 | Next ] - Last Post: 21 Jul 21, 22:53 Last Post By: xexyl Threads: [ Previous | Next ]
JeffTucker

Posts: 7,915
Registered: 31-Jan-2006
Re: Changed filter processing in 23.0.1
Posted: 18 Jul 21, 15:28   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
David is on holiday, I believe for another two weeks.
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 18 Jul 21, 15:30   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
David is on holiday, I believe for another two weeks.

Thank you mate! I can only hope he will reply when he's back... Very frustrated and annoyed at this.
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 18 Jul 21, 17:13   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Addendum: It's only the ReflectionFilter that no longer is functioning right. Based on what II'm seeing I have a thought on what it might be (or where it might be located) but I'll have to look at it another time probably.

If I can get it working that would be great.
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 18 Jul 21, 21:30   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
I just spent a few minutes doing the following:

  • Rename is*() to get*() (there were a couple instances of those).
  • Add many get*() methods (increasing the file size quite a lot too but as it's compiled I suppose it doesn't matter too much).
  • Go through every class field and make sure there's no literal reference to any of them except in the methods that set and get them.
  • Rename some fields that had different method names (so get* and set* act on the name of the variable exactly - I don't know if this is necessary but I wanted to be sure).
  • When it calls the filter method on another filter that's part of the skin I even used a getter method on that call just to rule that out too.

And it still does not work. There's only one difference: a strange effect that the filter had (definitely not right and never was before this jAlbum release) is no longer there. Instead it's just the original image. If you want I can upload the filter file and the init.bsh but both are long (and now ReflectionFilter.java is much longer after these changes). I'd still prefer my other request being fulfilled but I gather that that's not an option.

For now I'm done with this. Have other things to do.
davidekholm

Posts: 3,839
Registered: 18-Oct-2002
Re: Changed filter processing in 23.0.1
Posted: 19 Jul 21, 15:59   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Sorry about causing this frustration. I just consider it pretty important to not restrain the image processing to one thread when even laptops have 4 cores these days. Please attach a zip of the source code here and a modification to the Minimal skin or project that makes use of your filter so I can quickly reproduce the problem.

As I'm on vacation, I can't promise a super fast resolution to this, but I'll try.
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 19 Jul 21, 16:53   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Sorry about causing this frustration. I just consider it pretty important to not restrain the image processing to one thread when even laptops have 4 cores these days. Please attach a zip of the source code here and a modification to the Minimal skin or project that makes use of your filter so I can quickly reproduce the problem.

As I'm on vacation, I can't promise a super fast resolution to this, but I'll try.


First: I hope you're having a good holiday.
Second: Don't worry about looking at this on holiday. It's not that big of a deal!

Third: I am going to test if the other filters do actually work okay because I did see some oddities with the other filters that I don't recall seeing in the older versions. What I'll do is run the same settings on the older version and the newer version.

Fourth: As for uploading would it not be easier for both of us if I just linked to you my skin and then uploaded the source code here of the one filter (I could do the others but I imagine if we can figure out what the problem is I can make the others work). This way you have the settings available and all the features. My skin actually isn't all that complex but there are a lot of options to the filters.

Fifth: As for the JavaBean specification I did update the ReflectionFilter and it still doesn't seem to work (the problem is the images aren't mirrored - I just see the original image; please note that my skin allows for having just the original image or - the default - showing the original image and the mirror image in the direction - or directions - of the mirroring).

Six: What's strange is the TranslucentFilter does not follow the specification but this one does work but maybe that's not needing state; I don't know.

Seven: Yes laptops have 4 cores at the least but is it possible to mark some filters as using one? I didn't think it needed state but maybe it does anyway (at least with only the simplest configuration - the filters can be chained together for different effects).

Please let me know about the upload of the source code and the skin as I think that would be the better way to go about it as it has all the features configured (it'd take a while to get it to work in Minimal skin) and you can see for yourself how it works. Then I could just upload the one filter here for you to look at (I show the source code for the skin but not the filters in the skin directory).

Thank you for the reply, be safe and have a great remainder of your holiday! We can talk about this when you're back.

Cheers.
davidekholm

Posts: 3,839
Registered: 18-Oct-2002
Re: Changed filter processing in 23.0.1
Posted: 19 Jul 21, 17:01   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Thanks for understanding. Well, you can link to the skin and upload the source code here.
I've added an experimental addition to v24.1.1 that might help in situations like yours: Mark your skin as implementing the Cloneable interface. jAlbum will then call "clone() on your skin instead of using getter- and setter methods to clone it. This will by default make a "shallow copy" of all fields of the filter. That's usually enough. If not, also implement the clone() method and do your own cloning there.

The advantage of calling clone is that it also clones references to AlbumBean and other support objects you may have. You also have the advantage to fully customize the cloning, if needed, by also implementing the clone() method.

To get hold of v24.1.1, do a core update via Tools->External tools->"jAlbum core update"
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 19 Jul 21, 17:39   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Thanks for understanding. Well, you can link to the skin and upload the source code here.

Of course I understand! We all need breaks from time to time and I didn't even expect you to reply on holiday. That takes dedication to be sure and it's to be highly appreciated and respected!

I've added an experimental addition to v24.1.1 that might help in situations like yours: Mark your skin as implementing the Cloneable interface. jAlbum will then call "clone() on your skin instead of using getter- and setter methods to clone it. This will by default make a "shallow copy" of all fields of the filter. That's usually enough. If not, also implement the clone() method and do your own cloning there.

I just tried it on the skin but no luck. Or is it the filter too? If it's just the skin you can see the source code in my skin itself but here's the implementing Cloneable. The skin only has two java files and one is SkinModel.java but it has several filters too. I'm attaching these as well as the most recent ReflectionFilter.java file. I am not convinced as I was yesterday that the other filters (except TranslucentFilter) are working properly but maybe this filter will give you an idea - and it's the core filter of the skin (Carl suggested I make the skin for the filter itself though at that time it was to use Kristoffer's Exposure jQuery plugin).

As for ReflectionFilter.java you'll see that there are a lot of options and it refers to other filters too but it doesn't work even with those features disabled. As I said it just returns the original image as if the filter wasn't run at all. I should probably add a stack trace and I can if you think that might help (just tell me where). As for the skin I'm uploading the jaskin file here too though that will duplicate the two java files for the skin itself.


The advantage of calling clone is that it also clones references to AlbumBean and other support objects you may have. You also have the advantage to fully customize the cloning, if needed, by also implementing the clone() method.

I'm not sure what I need to do here though.

To get hold of v24.1.1, do a core update via Tools->External tools->"jAlbum core update"

Thank you so much for considering this! I really appreciate it and all the more since you're on holiday! I also apologise that the ReflectionFilter is more cluttered but trying to get the getter/setters in place made a lot of extra code; before I referred to fields directly but now it's all getter method calls. And I'm afraid that I make much use of ternary operator; that probably comes from my favourite language being C but it does make these many calls much simpler too.
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 19 Jul 21, 17:51   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Attachment Elephant.jpg (130.1 KB)
Attachment Elephant-Mirror.jpg (244.7 KB)
Just so you can see the most basic option in the filtering in the older version of jAlbum and the current... The one with the reflection is the old and the other is the new. Maybe that'll help you get an idea.

The other filters I could do similar but there are a lot of options (and in fact there are more features in the ReflectionFilter as well but those don't work either and I suspect that if the one works the others will work too).

Thank you again!
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 19 Jul 21, 20:00   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Great news! Adding implements Cloneable to the filter makes it work! I have something I have to do in a minute but after that's done I will do this on all the other filters; then when this release is official I will update the skin.

Thank you so much! I hope Chris can also do this.
davidekholm

Posts: 3,839
Registered: 18-Oct-2002
Re: Changed filter processing in 23.0.1
Posted: 20 Jul 21, 09:45   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
Hi. Good that it works for you too. I polished the jalbum-core.jar code a bit so do a core update so you get the most current one. I'm attaching my modification to ReflectionFilter.java here as reference. It now implements Cloneable (which seems to be enough) but also implements the clone method so you can do any customizations to the cloning process, if needed:
    public Object clone() throws CloneNotSupportedException {
        ReflectionFilter clone = (ReflectionFilter)super.clone();
        // Any customizations to the clone here
        //System.out.println("Custom clone");
        return clone;
    } 


Let Chris know about this approach. It probably helps him too. If not implementing Cloneable is enough, it should always be possible to get it working by adjusting the cloning process by a custom clone method.
davidekholm

Posts: 3,839
Registered: 18-Oct-2002
Re: Changed filter processing in 23.0.1
Posted: 20 Jul 21, 09:54   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
xexyl wrote:

I also apologise that the ReflectionFilter is more cluttered but trying to get the getter/setters in place made a lot of extra code; before I referred to fields directly but now it's all getter method calls.

You can use direct class member variable references. The getters and setters are only needed for the public interface you wish external users to use AND they were needed for the earlier cloning process, but now with the new Cloneable approach, they aren't used for the cloning.
xexyl

Posts: 181
Registered: 1-Sep-2009
Re: Changed filter processing in 23.0.1
Posted: 20 Jul 21, 15:23   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
xexyl wrote:

I also apologise that the ReflectionFilter is more cluttered but trying to get the getter/setters in place made a lot of extra code; before I referred to fields directly but now it's all getter method calls.

You can use direct class member variable references. The getters and setters are only needed for the public interface you wish external users to use AND they were needed for the earlier cloning process, but now with the new Cloneable approach, they aren't used for the cloning.


Yep, I only had the getters before the Cloneable fix. This simplifies the filter code quite a bit.

Thank you very much again for fixing this!
davidekholm

Posts: 3,839
Registered: 18-Oct-2002
Re: Changed filter processing in 23.0.1
Posted: 20 Jul 21, 17:35   in response to: xexyl in response to: xexyl
 
  Click to reply to this thread Reply
You're welcome
ctwist

Posts: 644
Registered: 27-Sep-2003
Re: Changed filter processing in 23.0.1
Posted: 20 Jul 21, 18:13   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
So is cloning the new recommended approach, or is this just a workaround if the previously recommended approach fails?
Legend
Forum admins
Helpful Answer
Correct Answer

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