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



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

Posts: 529
Registered: 5-Dec-2013
Re: jAlbum 14.2 beta for testing
Posted: 13-Nov-2017 19:33   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
karlmistelberger wrote:
davidekholm wrote:
Please attach the image

  • The attached image is handled well by v14.1.3. It also causes no problem when used as the single image in a new project with v14.2b13.

Fixed in b14. Get it from http://jalbum.net/download/beta/jalbum-core.jar


v14.2b13 indeed creates a thumbnail from Zeta Ophiuchi.jpg without further ado. ;-)
davidekholm

Posts: 3,573
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 13-Nov-2017 19:35   in response to: jGromit in response to: jGromit
jGromit wrote:
I believe that what we're gradually uncovering here is a long-uncorrected problem with the fixed-shape filter. I've posted about it before, but it's never been addressed. https://jalbum.net/forum/thread.jspa?threadID=49192

Here's a clear example. The theme image bounds are set to 1600x400, so we should get a 4:1 image. The crop focus shows a 4:1 mask over the image, which should indicate what the processed image will contain - a bit of the foreground, and the mountain range. But what it produces, folderimage.jpg, is quite different, indeed.

Original image for download: https://jgromit.jalbum.net/dv02.jpg


Thanks for reporting. Can you also attach that original image please
davidekholm

Posts: 3,573
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 13-Nov-2017 19:36   in response to: davidekholm in response to: davidekholm
BTW: I just updated the core file to b14. The theme image and representing image selectors now scale up if you enlarge the folder property panel. This makes it easier to play with setting the crop focus.
jGromit

Posts: 7,494
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 13-Nov-2017 19:41   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
Thanks for reporting. Can you also attach that original image please

Link in the post (too large for an attachment).
jGromit

Posts: 7,494
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 13-Nov-2017 19:43   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
BTW: I just updated the core file to b14. The theme image and representing image selectors now scale up if you enlarge the folder property panel. This makes it easier to play with setting the crop focus.

Excellent - I was just about to ask for that. The default size is a little tiny, depending on what the theme image is like.
davidekholm

Posts: 3,573
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 13:10   in response to: AndreWolff in response to: AndreWolff
Thanks André and jGromit for highlighting the stupid bug I had in the cropping calculation. Here's a fixed version:
import java.awt.Dimension;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.logging.Level;
import net.jalbum.filters.CropFilter;
import se.datadosen.jalbum.AlbumImage;
import se.datadosen.jalbum.AlbumObject;
import se.datadosen.jalbum.EmbeddedProperties;
import se.datadosen.jalbum.JAlbum;
import se.datadosen.jalbum.JAlbumUtilities;
 
Dimension themeDim = engine.getThemeImageDim();
AlbumObject theme = JAlbumUtilities.getThemeObject(currentFolder);
if (themeDim != null && theme != null) {
    File themeFile = new File(outputDirectory, "ja_theme.jpg");
    EmbeddedProperties existing = new EmbeddedProperties(themeFile);
    EmbeddedProperties current = new EmbeddedProperties();
    current.put("themeSrc", theme.getPathFrom(currentFolder));
    current.put("themeDim", themeDim.width + "x" + themeDim.height);
    if (!engine.isAppendImages() || JAlbumUtilities.isDirty(themeFile, theme) || !existing.equals(current)) {
        JAlbum.logger.log(Level.FINE, "Regenerating theme image ja_theme.jpg (" + themeDim.width + "x" + themeDim.height + ") for folder {0} ", currentFolder);
        AlbumImage ai = new AlbumImage(theme);
        CropFilter cf = new CropFilter();
        double ratio = (double) themeDim.width / themeDim.height;
        int width = ai.getBufferedImage().getWidth();
        int height = ai.getBufferedImage().getHeight();
        Dimension bounds = new Dimension(width, (int) (width / ratio));
        if (bounds.height > height) {
                bounds = new Dimension((int) (height * ratio), height);
        }
        cf.setBounds(bounds);
        ai = ai.applyFilter(cf, (Map) theme.getVars());
        ai = ai.scaleToFit(themeDim);
        ai.saveImage(themeFile);
        current.write(themeFile);
    }
}
davidekholm

Posts: 3,573
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 13:12   in response to: davidekholm in response to: davidekholm
There's a new beta core file out now. This version does background loading of a higher resolution image for the thumbnail and theme image selectors. The difference becomes noticeable if you enlarge the folder settings panel.
davidekholm

Posts: 3,573
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 13:20   in response to: RobM in response to: RobM
Attachment CropFocus.jaext (32.9 KB)
RobM wrote:
Bug in 14.b13: when setting crop focus.
Open the sample portfolio and then a subfolder, select the 'Use as thumbnail' thumbnail and then select the crop focus.

codeException in thread "AWT-EventQueue-0" java.lang.NullPointerException


Thanks for reporting Rob. This will be fixed in the next update. I've attached a fixed cropFocus.jaext file which you can put in jAlbum's "ext" folder to fix this.
jGromit

Posts: 7,494
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 13:38   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
...the stupid bug I had in the cropping calculation. Here's a fixed version....

That's more like it!

Another change that needs to be noted, however. Placing this in a listener in onload.bsh has absolutely no effect. It doesn't change the crop focus mask, and it doesn't change the cropping of the theme image:
engine.setThemeImageDim(new Dimension(1600, 400));
The only thing that makes any difference is this:
folderImageSize.setText("1600 x 400");
And that doesn't kick in until you close the settings panel in the skin or click Make Album. At that point, the mask does change, and the new dimensions are used to process the image.
AndreWolff

Posts: 1,715
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 13:59   in response to: davidekholm in response to: davidekholm
Attachment Minimal.jaskin (79.0 KB)
Yes David, that solves the biggest problem, see this test album.

The corrected Minimal.jaskin file is attached.

However there is still a problem:

The Objects folder has no theme image, because I did not yet touch or dragged the theme image in the Folder panel of the Objects folder. I slightly shifted the default theme image of the Travel folder and see there is now also a theme image.

Edit:
Sorry David, I did not check it again, but the Remove menu works now as I hoped it should work.
It removes now also the Theme image of an album generated with the attached Minimal skin with Theme image support.

Edited by: AndreWolff on 14-Nov-2017 14:21
jGromit

Posts: 7,494
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 14:17   in response to: davidekholm in response to: davidekholm
The behavior of the Remove option is puzzling.

Using my MinimalTinker skin (with newer postdir.bsh code, from above), if I remove the theme image, the preview/cropping pane does, indeed, go blank. But postdir.bsh is still detecting a theme image, and produces an output ja_theme.jpg. It's using the image chosen for the folder thumbnail. Nothing makes the theme image preview come back - saving, closing, relaunching, etc.

But if I switch to Tiger, it magically appears.

Edit: The difference in skins is that MinimalTinker is telling jAlbum that it supports separate theme images (even though the actual page coding does nothing with them).
davidekholm

Posts: 3,573
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 14:56   in response to: jGromit in response to: jGromit
jGromit wrote:
davidekholm wrote:
...the stupid bug I had in the cropping calculation. Here's a fixed version....

That's more like it!

Another change that needs to be noted, however. Placing this in a listener in onload.bsh has absolutely no effect. It doesn't change the crop focus mask, and it doesn't change the cropping of the theme image:

engine.setThemeImageDim(new Dimension(1600, 400));
The only thing that makes any difference is this:
folderImageSize.setText("1600 x 400");
And that doesn't kick in until you close the settings panel in the skin or click Make Album. At that point, the mask does change, and the new dimensions are used to process the image.

If you have a UI component or skin variable from SkinModel called folderImageSize or matching the name pointed to by the themeImageSizeName skin property, then the dimension read from that one will overwrite anything you've set in the engine.setThemeImageDim() call. The key thing is that setThemeImageDim is called, either directly in onload and init or indirectly via the presense of a matching UI component or skin variable.

To get the best behavior from the user's point of view, use a StateMonitor to update that hidden UI component, then call engine.setThemeImageDim, passing the same dimension as you fed into the UI component, but as a Dimension object of course. This setup should ensure that the crop focus selector updates as soon as the skin changes this dimension. (It's the call to engine.setThemeImageDim() that triggers the UI update)
davidekholm

Posts: 3,573
Registered: 18-Oct-2002
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 14:58   in response to: jGromit in response to: jGromit
jGromit wrote:
The behavior of the Remove option is puzzling.

Using my MinimalTinker skin (with newer postdir.bsh code, from above), if I remove the theme image, the preview/cropping pane does, indeed, go blank. But postdir.bsh is still detecting a theme image, and produces an output ja_theme.jpg. It's using the image chosen for the folder thumbnail. Nothing makes the theme image preview come back - saving, closing, relaunching, etc.

But if I switch to Tiger, it magically appears.

Edit: The difference in skins is that MinimalTinker is telling jAlbum that it supports separate theme images (even though the actual page coding does nothing with them).


The "Remove" name is somewhat misleading (didn't want to force another translation round). It actually means "Remove custom theme image and use same as folder thumbnail.
AndreWolff

Posts: 1,715
Registered: 14-Dec-2007
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 15:02   in response to: davidekholm in response to: davidekholm
Attachment AfterRemove.PNG (68.5 KB)
davidekholm wrote:
The "Remove" name is somewhat misleading (didn't want to force another translation round). It actually means "Remove custom theme image and use same as folder thumbnail.
?? That is not what I see after I selected the Remove menu there is no folder theme image, see attached screenshot.

And I like this so keep it as it is now!

Edited by: AndreWolff on 14-Nov-2017 15:02
jGromit

Posts: 7,494
Registered: 31-Jan-2006
Re: jAlbum 14.2 beta for testing
Posted: 14-Nov-2017 15:20   in response to: davidekholm in response to: davidekholm
davidekholm wrote:
To get the best behavior from the user's point of view, use a StateMonitor to update that hidden UI component, then call engine.setThemeImageDim, passing the same dimension as you fed into the UI component, but as a Dimension object of course.

Yes, sequence is everything! This, sitting in a StateMonitor(), produces consistent behavior with proper visual feedback:
folderImageSize.setText("1600 x 400");
engine.setThemeImageDim(new Dimension(1600, 400));
Legend
Forum admins
Helpful Answer
Correct Answer

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