Posts:
8
Registered:
22-Jun-2014
|
|
|
Posts:
8,436
Registered:
31-Jan-2006
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 00:18
in response to: crudmucosa
|
|
|
As with the other user's "problem" images, if I grab your original, and use your project settings, I get an image with no color problems. Very mysterious.
There's only one setting that is platform dependent, i.e., your hardware could be producing a different result. As a quick experiment, try turning off Settings > Images > Advanced > Attempt to use hardware accelerated scaling, then forcing new image generation.
And what happens if you make an album consisting only of that image? If that produces proper colors, that suggests some kind of multi-threading problem.
|
|
|
Posts:
8
Registered:
22-Jun-2014
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 00:45
in response to: JeffTucker
|
|
|
Hi Jeff!
So I did an uninstall and reinstall of 25.1.1. I wiped out the defaults and skin .jap files in the Config dir. I fired up jalbum, clicked on my birds album then swapped to a different skin (went from Tiger to PhotoBlogger) then went back to Tiger again. Deleted the local album files using the menu options you gave.
Did a rebuild of the album and saw the discoloration still:
http://birds.picturesofus.net/Harriss%20Hawk/index.html#img=DSC_5365.jpeg
the original looks fine:
http://birds.picturesofus.net/Harriss%20Hawk/DSC_5365.jpeg
I gave the multithreading-to-single-thread option a try right now to see what happens (other than expecting the album build to run quite slow like you said  ). No discoloration! I even tried adding some fresh photos to see if it introduced discoloration...nope! I haven't uploaded the fixed album as yet in case you want to see the discolored example posted above.
Cheers
Ahhhh nope! Spoke too soon. The reason I'm not seeing the discolored thumbnails is because my tiger skin settings defaulted back to the Pages => "Link to Originals" setting instead of the "Link to originals via scaled images" setting I usually have them on. As soon as I turned on the scaled images setting, I see the discoloration again. sigh
Are you saying that the link settings are changing by themselves? No skin defaults to Link to originals.
But the linking wouldn't matter - the thumbnails are always pumped through the image processor. That setting affects only the slide images.
Finally, even changing skins doesn't automatically regenerate the thumbnails or slides. The only thing that causes that is changing the image bounds, or forcing reprocessing by choosing Force Remake.
I'm sorry you're having these problems, but until someone can boil this down to a small album that shows the error, and in a way that someone else can reproduce, there's not much that can be done. Doing a complete uninstall/reinstall is absolutely vital, and reverting to all default settings would help narrow things down. Open your config directory - Tools, Open directories, Config directory - and delete defaults.jap, along with any skin defaults, like Tiger-defaults.jap.
Then, after making sure that you have backup copies of your project, choose a different skin, then, without even processing the album, switch back to the original skin. This will reset all of the skin settings to their default values. Delete the output - click the little down-arrow next to the project name and choose Delete, Delete local album. Now Make Album.
If you're still seeing the problem, start excluding things and doing forced remakes until you can zero in on which objects seem to be triggering the problem. The objective of this exercise is to get to an album that shows the problem, but that's small enough to zip up and pass along to David.
One random thought.... On the theory that there's some sort of multi-threading issue, go to Tools, Preferences, Advanced, and change the number of threads to 1. Now do a Force Remake. This will definitely be much slower, but it might shed some light on what's happening.
And, as always, if you see a little warning triangle at lower right, open the system console (F7), and copy and paste whatever messages you see there (beyond the boilerplate, which ends with "You can interact with any Java object").
|
|
|
Posts:
8,436
Registered:
31-Jan-2006
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 00:47
in response to: crudmucosa
|
|
|
Oh, that's really interesting! Alas, it will be a bitch to track down. Somewhere in there, there's a routine that's not truly thread-safe. But how to find it?!
At least it will keep David off the streets for a while.
ETA: David, I notice that these users are using the Effects > Auto options. Let's just say that I have a hunch....
|
|
|
Posts:
8
Registered:
22-Jun-2014
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 00:56
in response to: JeffTucker
|
|
|
Bwahaahah! Right on. Diagnosing thread issues was always a pain in the ass for me when I was still allowed to touch code at work (I've been a management goon for awhile now) and when I code for fun or with my kids at home, I mostly just try to use languages and libraries that are as thread-safe as I can find (but I mean...don't we all!?).
I am happy to do my part to keep David off of the streets  .
Is there anything else I can provide to help out?
Cheers,
-Desmond
Oh, that's really interesting! Alas, it will be a bitch to track down. Somewhere in there, there's a routine that's not truly thread-safe. But how to find it?!
At least it will keep David off the streets for a while. 
|
|
|
Posts:
3,624
Registered:
18-Oct-2002
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 18:11
in response to: crudmucosa
|
|
|
I'm naturally eager to track this one down, but the challenge is that I don't know how to reproduce it here. Desmond, can you try switching off any image effects, for instance auto correct under Settings->Effects and see it it makes any difference (keep multiple threads active). If it works, then selectively add one effect at a time and remake the project until it fails again. Is it the auto correct in combination with multiple threads perhaps? (We had a student write the auto correct code once....hmmm....)
|
|
|
Posts:
8,436
Registered:
31-Jan-2006
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 18:21
in response to: davidekholm
|
|
|
Good news. I can reproduce this, with a fairly manageable project. And it's triggered by either the Auto Contrast or Auto Levels setting. The discoloration is different in each case, but it's definitely ugly.
I'll email you a link to the zipped project. The nice thing about the demo is that all of the images have a similar "look and feel," so the discolored ones jump off the screen at you!
ETA: It looks like Auto Levels is the villain. Auto Contrast seems to be OK.
|
|
|
Posts:
3,624
Registered:
18-Oct-2002
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 18:35
in response to: davidekholm
|
|
|
Jeff helped me reproduce this. Now working on fixing it.
|
|
|
Posts:
3,624
Registered:
18-Oct-2002
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 22:14
in response to: davidekholm
|
|
|
I've now identified the cause of this and fixed it. Please open jAlbum and select Tools->External->Tools->"jAlbum core update" to apply the fix. Restart jAlbum when prompted. The splash screen should say 25.1.2. You need to issue a "Force rebuild" to have jAlbum reprocess all images.
(The cause of the problem was that the Auto correct filter wasn't being cloned deeply when applied to multiple threads - it shared common data structures that polluted each other. I now implemented a proper deep clone.)
|
|
|
Posts:
8,436
Registered:
31-Jan-2006
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
23 Nov 21, 22:30
in response to: davidekholm
|
|
|
Looks solid, at least in my test project.
|
|
|
Posts:
3,624
Registered:
18-Oct-2002
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
24 Nov 21, 11:42
in response to: JeffTucker
|
|
|
Looks solid, at least in my test project.
Good. I'm pretty confident that we've nailed this one now. To explain the issue in more detail: With jAlbum 23.1 (I believe) I removed a bottleneck in jAlbum's image processing. It turned out that all image filtering were being done through one single thread, even on multi-core CPUs. I first addressed this by running the same image filter instance simultaneously on multiple threads. This worked for the majority of filters, but not for filters that maintained state (class variables in Java lingo). As long as a class is modifying local variables (stored on the stack), multi-thread calls are safe, but not when a class is modifying instance variables.
Now, to address this I could either have rewritten all filters that maintained state, but there are 3:rd party filters too, most notably the gigantic XBorderFilter, so I didn't want to go down that path. Ensuring "thread safety" would complicate the design of some of these filters, so I decided to clone a "template" filter instance and use the clones on each thread. Depending whether a specific filter implements the Cloneable interface or not, we do the cloning in different ways. Now, the ArtyFilter implemented Cloneable so jAlbum 23 and on wards has been cloning it, but it turned out that the default clone behavior is a "shallow copy", i.e. all primitive variables are cloned, but all other types are "cloned-by-reference", meaning that the final clones will have a reference pointer pointing to the original instance variable. It now becomes a shared variable and we suffer from the same problem of threads polluting the state of each other as we did prior to cloning. I solved the problem by customizing the clone behavior of the Auto correct filter so ALL state variables are properly cloned, including the various array-type instance variables.
(I was under the misconception that array-type variables are also automatically "cloned-by-value", but they are treated like any other Objects, and therefore cloned-by-reference.)
|
|
|
Posts:
8,436
Registered:
31-Jan-2006
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
24 Nov 21, 14:29
in response to: davidekholm
|
|
|
I love it when you talk dirty.
|
|
|
Posts:
8
Registered:
22-Jun-2014
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
24 Nov 21, 16:15
in response to: davidekholm
|
|
|
Awesome! Thank you for the hard work and the detailed explaination of the issue and your debugging. Great stuff
Looks solid, at least in my test project.
Good. I'm pretty confident that we've nailed this one now. To explain the issue in more detail: With jAlbum 23.1 (I believe) I removed a bottleneck in jAlbum's image processing. It turned out that all image filtering were being done through one single thread, even on multi-core CPUs. I first addressed this by running the same image filter instance simultaneously on multiple threads. This worked for the majority of filters, but not for filters that maintained state (class variables in Java lingo). As long as a class is modifying local variables (stored on the stack), multi-thread calls are safe, but not when a class is modifying instance variables.
...
I solved the problem by customizing the clone behavior of the Auto correct filter so ALL state variables are properly cloned, including the various array-type instance variables.
(I was under the misconception that array-type variables are also automatically "cloned-by-value", but they are treated like any other Objects, and therefore cloned-by-reference.)
Edited by: crudmucosa on 24 Nov 2021, 16:16
|
|
|
Posts:
3,624
Registered:
18-Oct-2002
|
|
|
Re: NEED HELP ASAP !! Pictures were discolored after create album.
Posted:
24 Nov 21, 16:45
in response to: crudmucosa
|
|
|
Jeff loves my long explanations  You're welcome!
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|