The FixedShapeFilter is not being applied correctly. Attached is a zipped-up project with four images. Image bounds are set to 400x400. There's a user variable:
filter1 class=FixedShapeFilter closeups
In the final album, the slide pages all indicate that the slide images are 400x400. But open the output directory and take a look at the actual slide images - they're NOT all 400x400. They're all square, but they have different dimensions.
Adding prescale to the filter makes no difference.
BTW, this bug afflicts thumbnails, as well. If you specify thumbnail bounds of 300x300 and invoke the FixedShapeFilter, you get thumbnails that are all square, but that are not all exactly 300x300 pixels. Oddly, it behaves properly if you drop back to 240x240 for the thumbs.
jAlbum has no support for the combination of "closeups" and "prescale" so it ends up ignoring "prescale". If we consider this a bug, it's actually a bug or limitation of jAlbum and not of the FixedShapeFilter. See the javadocs for JAFilter for the currently available "filter stages" that jAlbum maps combinations of the "closeups", "thumbnails" and "prescale" parameters to. I don't know whether we should complicate the filter pipeline further by allowing the combination of "prescale" and "closeups", but a warning message would at least help
The original image is huge, typical "straight out of the digital camera" size. I've specified 400x400 thumbnails, and told Minimal to create fixed-shape thumbnails (the Minimal init.bsh specifies prescale). The output thumbnail image is 335x335 pixels. Why? And the index page is showing a width and height for that image of 400px. Again, why?
The slide image bounds are 500x500. I've added a user variable to make the slide image a fixed shape, as well. The output slide image is 335x335 pixels. And the slide page is showing a width and height of 500px for that image file, which is simply wrong.
But do you see what I'm really driving at, here? Take my last example (single large image). I've told it I want 400x400 thumbnails, fixed shape. It won't do it. But then it gets weird. If I change the image bounds (not the thumbnail bounds) from 500x500 to 640x640, the thumbnail is now 400px square, as it should be.
In short, the setting of the image bounds is having an effect on the thumbnail images. This is hardly what a user would expect!
I think I can sum up the problem, here. The FixedShapeFilter is doing what it says it will do - it produces a thumbnail or slide image whose aspect ratio matches the aspect ratio of the image bounds. But the final dimensions of the image are almost unpredictable.
For a fixed shape thumbnail, I would expect the filter to crop the original image to the aspect ratio defined by the thumbnail bounds, then scale it. So if you set thumbnail bounds of 400x400, you would always get a 400x400 thumbnail as long as the original is at least 400x400 pixels.
The same would be true for a fixed shape slide image - crop to the aspect ratio of the slide image bounds, then scale. Again, as long as the originals were larger than the slide image bounds, the fixed shape slide images would all have the same dimensions.
That's clearly not what's happening. For slide images, it seems to be scaling, then cropping, rather than the other way around. For thumbnail images, I can't quite wrap my head around what it's doing. The final dimensions of the thumbnail image are affected by the slide image bounds, which shouldn't be related at all.
An update: with all current betas applied - jAlbum 14.2b14, new CropFocus extension - the fixed shape behavior is still bizarre.
Specifying image bounds of 500x500 to a huge original image, with the fixed shape filter, produces a slide image that's 335x335.
Specifying thumbnail bounds of 400x400 produces a thumbnail that's also 335x335.
This makes no sense to me. Why do I not get a 500x500 slide and a 400x400 thumbnail?
It's important that you apply the FixedShapeFilter BEFORE image scaling takes place. If you use the engine.addFilter API, pass JAFilter.ALL_PRESCALE_STAGE as stage for closeups and THUMBNAILS_PRESCALE_STAGE for thumbnails only
Sorry, but that makes no difference. In the zipped-up example, the skin is already using JAFilter.THUMBNAILS_PRESCALE_STAGE for thumbnails. The slide filter is in the user variables, and adding prescale to it doesn't change the behavior.
I still get 335x335 slide and thumbnail, despite image bounds of 500x500 and thumbnail bounds of 400x400 (the zipped example has 124x124 for thumbnail bounds, so change them for testing).
No, it's even weirder than that. Add bears1.jpg to my zipped-up project. It's 600x450.
For the slide, I'd expect it to crop it square (450x450), then scale it to 500x500 bounds, yielding 450x450, since the image is actually smaller than the bounds. But it spits out a 375x375.
For the thumbnail, I'd expect it to crop it square (450x450), then scale it to 400x400 bounds, yielding 400x400. But it also produces a 375x375
The originally-included dv01.jpg is 3872x2592. That should crop square, to 2592x2592, then scale to 500x500 (for the slide) and to 400x400 (for the thumbnail). Both end up 335x335, even smaller than the bears1.jpg!