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


Permlink Replies: 7 - Pages: 1 - Last Post: 12 Oct 22, 17:07 Last Post By: JeffTucker Threads: [ Previous | Next ]
JeffTucker

Posts: 8,445
Registered: 31-Jan-2006
Changed behavior of theme image generation
Posted: 23 Sep 22, 22:13
 
  Click to reply to this thread Reply
There's a change in the behavior of the theme image processor.

In jAlbum 28.1.5, if you tell it to make the images all WebP, the theme image is still a JPG. However, if the skin specifies the name of the theme image as, e.g., mytheme.webp, you do, in fact, get a WebP image.

In jAlbum 29, it still cranks out a JPG theme image, even if you tell it to make the images all WebP. But now, the skin can no longer tell the core that the theme image name is mytheme.webp. That produces an error, and the album build aborts.

Edited by: JeffTucker on 25 Sep 2022, 08:31, to remove confusing tangent.
RobM

Posts: 4,378
Registered: 4-Aug-2006
Re: Changed behavior of theme image generation
Posted: 23 Sep 22, 22:48   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I'm using theme image method 2
engine.setThemeImageProcessor(custom);
purely because the built in routine doesn't handle the change of output format. If it did I would use it for standard theme images. I only have one old skin using the do-it-yourself method.
JeffTucker

Posts: 8,445
Registered: 31-Jan-2006
Re: Changed behavior of theme image generation
Posted: 23 Sep 22, 22:51   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
It's been so long since I messed with these routines, I'm hard-pressed to remember how they behave. I'll need to experiment, perhaps after a few stiff drinks.
davidekholm

Posts: 4,399
Registered: 18-Oct-2002
Re: Changed behavior of theme image generation
Posted: 12 Oct 22, 15:55   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
The ThemeImageProcessor relies on the Apache Commons Imaging project to embed XMP properties within the generated image, and this library obviously doesn't support WebP, so for now you have to keep JPEG format for the theme images.
davidekholm

Posts: 4,399
Registered: 18-Oct-2002
Re: Changed behavior of theme image generation
Posted: 12 Oct 22, 16:31   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
There's a change in the behavior of the theme image processor.

In jAlbum 28.1.5, if you tell it to make the images all WebP, the theme image is still a JPG. However, if the skin specifies the name of the theme image as, e.g., mytheme.webp, you do, in fact, get a WebP image.

In jAlbum 29, it still cranks out a JPG theme image, even if you tell it to make the images all WebP.


How? Code please? I did the following in init.bsh for Minimal skin, and it does indeed try to generate a webp image, but then bails out when trying to embed XMP properties within it:
class MyProcessor extends ThemeImageProcessor {
    public String getThemePath(AlbumObject folder) {
        return "foo.webp";
    }	
}
 
engine.setThemeImageProcessor(new MyProcessor());


But now, the skin can no longer tell the core that the theme image name is mytheme.webp. That produces an error, and the album build aborts.

How do you try to change the name?

I will release a silent update to v29.0.1 where I also update several image related files. This update will ensure that jAlbum won't bail out but instead print a warning message to the system console if you try to use webp for theme images. It works, but they are re-generated every time as the Apache Commons Imaging library doesn't recognize webp. In jAlbum 28.1 that library silently ignored trying to embed properties in webp files. Now it at least throws an exception so we're told about the problem.

So in essence: With v29.0.1 WebP theme images should work, but will crank out a warning to the system console because XMP properties can't be embedded, and this leads to regeneration of theme images every time.
RobM

Posts: 4,378
Registered: 4-Aug-2006
Re: Changed behavior of theme image generation
Posted: 12 Oct 22, 17:06   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
David, I used this in Journal skin
 //Set the them image name
themeImageName = "folderimage.jpg";
//Get the selected output format
if(engine.getOutputFormat().toString().equals("WebP")) {
	themeImageName = "folderimage.webp";
}
 
//Setup the custom theme image method
ThemeImageProcessor custom = new ThemeImageProcessor() {
  public String getThemePath(AlbumObject folder) {
    return themeImageName;
  }
};
 
//Invoke the theme image processor
engine.setThemeImageProcessor(custom);
JeffTucker

Posts: 8,445
Registered: 31-Jan-2006
Re: Changed behavior of theme image generation
Posted: 12 Oct 22, 17:06   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
The ThemeImageProcessor relies on the Apache Commons Imaging project to embed XMP properties within the generated image, and this library obviously doesn't support WebP, so for now you have to keep JPEG format for the theme images.

Ah, good to know.

Here's what RobM was doing in his Journal skin, with the now-non-working code commented out:
//Turn on theme image support, using the selected output format of jpg or webp
//Set the them image name
themeImageName = "folderimage.jpg";
/*
Does not work with Beta version of jAlbum 29
if(engine.getOutputFormat().toString().equals("WebP")) {
	themeImageName = "folderimage.webp";
}
*/
 
//Setup the custom theme image method
ThemeImageProcessor custom = new ThemeImageProcessor() {
  public String getThemePath(AlbumObject folder) {
    return themeImageName;
  }
};
 
//Invoke the theme image processor
engine.setThemeImageProcessor(custom);
It used to produce a WebP theme image, but in jAlbum 29, it crashed.

But to avoid the repeated regeneration of theme images, best to leave it alone for now.
JeffTucker

Posts: 8,445
Registered: 31-Jan-2006
Re: Changed behavior of theme image generation
Posted: 12 Oct 22, 17:07   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Simulpost, for the prize!
Legend
Forum admins
Helpful Answer
Correct Answer

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