Back in 2008 I needed to create thumbnails of images and limit the size of an image. I used something I found which I imported into a java agent and attempted to call it on a WebQuerySave event. Being that I didn't know much about java (though a lot about C++) I wasn't successful running the java agent.
I finally created a script library with an object of the code I found to resize the image called thumblib. I then used the following at the top of a LotusScript agent to call the java library.
Option Public
Use "thumblib"
Uselsx "*javacon"
It worked. I did find a bug with the java code in that if I uploaded an image with the same name as a previous image it had cached the previous thumb and would return the old file. Looking around I changed the code to the following, which fixed the problem.
Back in 2008 I needed to create thumbnails of images and limit the size of an image. I used something I found which I imported into a java agent and attempted to call it on a WebQuerySave event. Being that I didn't know much about java (though a lot about C++) I wasn't successful running the java agent.
I finally created a script library with an object of the code I found to resize the image called thumblib. I then used the following at the top of a LotusScript agent to call the java library.
Option Public
Use "thumblib"
Uselsx "*javacon"
It worked. I did find a bug with the java code in that if I uploaded an image with the same name as a previous image it had cached the previous thumb and would return the old file. Looking around I changed the code to the following, which fixed the problem.
// load image
// Image image = Toolkit.getDefaultToolkit().getImage(imagename);
// Use createImage instead of getImage because
// getImage may cache the image which we don't want.
Image image = Toolkit.getDefaultToolkit().createImage(imagename);