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


Permlink Replies: 23 - Pages: 2 [ 1 2 | Next ] - Last Post: 23-Nov-2018 23:13 Last Post By: jGromit
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Force processing of small images
Posted: 19-Nov-2018 03:56
 
  Click to reply to this thread Reply
If you have an original image that is, say, 1200x899px, like the attached image, and use it in an album in which the image bounds are 1500x1000px, it lands in the output directory unchanged. For the sake of processing efficiency, this makes sense.

But for the sake of website loading speed, the results are less than ideal. The original is almost 1.5Mb, despite the small dimensions. And yet, if you "fool" jAlbum into processing the image - by pumping it through the watermark filter, but with no text, for example - you end up with a slide image that is still 1200x899px, but with a file size that's less than one-quarter of the original, with no visible loss of clarity. See the attached file. And that's using 85% JPEG Quality, which is pretty generous.

It would be nice to have an option under Settings > Images > Advanced that tells jAlbum to process images even if their dimensions are smaller than the image bounds.
davidekholm

Posts: 3,680
Registered: 18-Oct-2002
Re: Force processing of small images
Posted: 19-Nov-2018 18:19   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Sounds reasonable, although this effect can be achieved, as you say, by adding an empty text filter for instance (any filter will do). Your suggestion is more intuitive though.
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Re: Force processing of small images
Posted: 19-Nov-2018 18:22   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Yes, I use the "empty filter" trick in NoPages, but that's a real kludge - almost embarrassing. ;)
davidekholm

Posts: 3,680
Registered: 18-Oct-2002
Re: Force processing of small images
Posted: 20-Nov-2018 17:01   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
Yes, I use the "empty filter" trick in NoPages, but that's a real kludge - almost embarrassing. ;)

Here's a bit less ugly workaround (put in init):
import java.awt.image.BufferedImage;
 
class DummyFilter implements JAFilter {
	public BufferedImage filter(BufferedImage bi, Map vars) { return bi; }
	public String getName() { return "Dummy"; }
	public String getDescription() { return ""; }
}
 
engine.addFilter(new DummyFilter());
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Re: Force processing of small images
Posted: 20-Nov-2018 17:08   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I can use that in NoPages, but I wouldn't want to implement that in a regular skin, with a skin UI checkbox to trigger it (there is just such a checkbox in NoPages). This is something that needs to be at the jAlbum core level.

I ran into this for the first time recently, when I started using larger image bounds (bigger monitor than I used to have). Of course, it's not a problem if your source material is all fairly recent digital images - even smartphone photos have sufficiently large dimensions to trigger processing. But older material, especially things saved from the web, are often "small dimensions, but way too many bits."
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Re: Force processing of small images
Posted: 20-Nov-2018 17:13   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I'm afraid that blows up.
An unexpected error occurred. Please see detailed description below:
 
java.lang.RuntimeException: java.io.IOException: java.io.IOException: se.datadosen.util.BeanBinderException
	at se.datadosen.jalbum.AlbumBean.getImageSettingsHash(AlbumBean.java:833)
	at se.datadosen.jalbum.AlbumBean.makeAlbum(AlbumBean.java:2731)
	at se.datadosen.jalbum.AlbumBean.smartMakeAlbum(AlbumBean.java:2689)
	at se.datadosen.jalbum.JAlbumFrame$5.run(JAlbumFrame.java:1062)
Caused by: java.io.IOException: java.io.IOException: se.datadosen.util.BeanBinderException
	at se.datadosen.jalbum.JSONEncoder.serialize(JSONEncoder.java:89)
	at se.datadosen.jalbum.JSONEncoder.serialize(JSONEncoder.java:61)
	at se.datadosen.jalbum.JSONEncoder.serialize(JSONEncoder.java:52)
	at se.datadosen.jalbum.JSONEncoder.serialize(JSONEncoder.java:24)
	at se.datadosen.jalbum.AlbumBean.getImageSettingsHash(AlbumBean.java:831)
	... 3 more
Caused by: java.io.IOException: se.datadosen.util.BeanBinderException
	at se.datadosen.jalbum.JSONEncoder.serialize(JSONEncoder.java:89)
	at se.datadosen.jalbum.JSONEncoder.serialize(JSONEncoder.java:80)
	... 7 more
Caused by: se.datadosen.util.BeanBinderException
	at se.datadosen.util.BeanBinder.getMap(BeanBinder.java:382)
	at se.datadosen.jalbum.JSONEncoder.serialize(JSONEncoder.java:68)
	... 8 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at se.datadosen.util.BeanBinder.getMap(BeanBinder.java:376)
	... 9 more
Caused by: java.lang.IllegalAccessError: DummyFilter.getName()Ljava/lang/String;
	... 14 more
davidekholm

Posts: 3,680
Registered: 18-Oct-2002
Re: Force processing of small images
Posted: 20-Nov-2018 22:55   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
See my "public" additions. I hope they do the trick.
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Re: Force processing of small images
Posted: 20-Nov-2018 23:20   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Yes, that works.

But I still want it as a jAlbum setting. Using it in init.bsh doesn't help with a project that uses another one of my skins, unless I want to force all users of that skin to invoke this alternative.
davidekholm

Posts: 3,680
Registered: 18-Oct-2002
Re: Force processing of small images
Posted: 21-Nov-2018 11:30   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Attachment texts.properties (72.1 KB)
jGromit wrote:
Yes, that works.

But I still want it as a jAlbum setting. Using it in init.bsh doesn't help with a project that uses another one of my skins, unless I want to force all users of that skin to invoke this alternative.


I agree. This was just a workaround that works on older versions. I've updated the beta to include support for this under Settings->Images->Advanced. You need the attached updated text file too.
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Re: Force processing of small images
Posted: 21-Nov-2018 13:07   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Oh, I like it. You may have an extra cookie with your lunch. :)

Now I can pull the kludge out of NoPages, and also fix some of my demo albums that use my other skins - when uploading some of the demo albums, using new, larger image bounds, I noticed some oddly large slide files. Even with my new speedy setup, it was noticeable (my old router was slower than my ISP's new speeds, but with a new router I'm now getting 110mbps down, 11mbps up).

I would change the text to something like Force processing of small images. The jAlbum user's manual can do a bit more explaining about it.
davidekholm

Posts: 3,680
Registered: 18-Oct-2002
Re: Force processing of small images
Posted: 21-Nov-2018 13:31   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
Oh, I like it. You may have an extra cookie with your lunch. :)

Thanks ;-)

I would change the text to something like Force processing of small images. The jAlbum user's manual can do a bit more explaining about it.

Done. Will appear in 17.1
RobM

Posts: 3,242
Registered: 4-Aug-2006
Re: Force processing of small images
Posted: 21-Nov-2018 21:54   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
Oh, I like it. You may have an extra cookie with your lunch. :)
Am I missing something?
Delete album output
Image bounds set much higher than image sizes
Settings/Images/Advanced/Force processing off
Build album, note the modified date and the file size.

Wait a few minutes.

Change Settings/Images/Advanced/Force processing to on
Build album, note the modified date and the file size - no change.
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Re: Force processing of small images
Posted: 21-Nov-2018 22:22   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Attachment originals.png (12.5 KB)
Attachment outForce.png (8.1 KB)
Attachment outNoForce.png (8.4 KB)
Ah, yes, it's not quite working the way one would want it to. It turns out that you need to delete the first slide image, turn the forced processing on, then build the album again. Even a Make All doesn't do the trick.

Test case, with 2000x2000 image bounds. Screenshots: Original images - note file sizes.
Output without forced processing - file size of Westerlund image unchanged. Output after deletion of slide images, then build with forced processing - file size of Westerlund finally under control.

Ideal behavior would be to do the forced processing with a simple change in the checkbox and a Make Album. And it should certainly do it with a Make All.
jGromit

Posts: 7,664
Registered: 31-Jan-2006
Re: Force processing of small images
Posted: 21-Nov-2018 22:26   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
Marking as unanswered - needs some tweaking to behave better.
RobM

Posts: 3,242
Registered: 4-Aug-2006
Re: Force processing of small images
Posted: 21-Nov-2018 22:29   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
Ah, yes, it's not quite working the way one would want it to. It turns out that you need to delete the first slide image, turn the forced processing on, then build the album again. Even a Make All doesn't do the trick.
Thanks for confirming, I'll wait for an update before writing anything in the wiki.
Legend
Forum admins
Helpful Answer
Correct Answer

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