« New Feature: Category Header Static Page | Main| Bugfix: MetaWebLogAPI now accepts content larger than one segment (>64kB) »

New Feature: Transparent support for better image resizing via "Import Image 2 Lotus Notes" (II2LN)

Tags: Image Handling

The open source Java agents doing the resizing in Blogsphere today, has some issues with the image quality for certain image types. For example will screenshots look bad when resized. I have therefore added completely transparent support for Import Image 2 Lotus Notes (II2LN), meaning that II2LN will automatically be used if it is installed, and quitly ignored if not. II2LN will resize images with much better quality, and other benefits is that you can import any kind of image type, such as PNG, TIF and BMP files! The best of all, II2LN is free to use together with Blogsphere!

Below you see two albums, where the first uses the standard Java-based resize, and the second uses the II2LN resizing;

A picture named M2

The results speak for themselves. This functionallity has been implemented like this;

All changes are in the script library BlogSphere.PhotoImport.

First of all , some definitions in the (Declarations)-section;

A picture named M3

Basically I define a global variable II2LNInstallCode which will reveal to the rest of the code whether II2LN is installed or not. Remember, the code should be completely ignorant to II2LN if it isn't installed. The other lines in the declaration defines some functions in in the VCII2LN.DLL. I have only defined the necessary functions to use in this implementation. II2LN contains several other functions, but since they aren't used here, I don't want to confuse you with non-used functions

Then, I have added two new functions to the script library, named VerifyII2LNVersion and II2LN_Resize. The first function do the actual check to see whether II2LN is installed or not. The result from this check is stored in the II2LNInstallCode variable. The second function do the actual resize with II2LN. I don't dive into these functions now, as they should be pretty self explanatory. However, I just want to mention that II2LN controls a lot of its functionality via so-called Import Options. An Import Option is essentially a function within II2LN and some parameters. You can have a bunch of Import Options when you use the ProcessImage-function. All import options are on the format of command:parameter(s). Multiple import options are separated with a semicolon.To make it a little bit easier to separate each import option and their parameters, I use the LotusScript list functionality to build up the string of import options.

The next functions which has got some changes is PhotoImport. The first change is at the very top of the function code;

A picture named M4
Here you see I call the VerifyII2LNVersion-function. If II2LN is present I allow for some more files to be imported. Note that this isn't fully implemented yet, so stick to JPGs The basic idea is that I will convert any other image format as the ordinary and existing loop process the images. I need to convert all the images to JPGs, since the existing code has a bunch of EXIF-code working only on JPGs. This is basically very easy to do with II2LN via the ConvertImage-function. However, I need some more test time to surface this functionality.

The last change is in the ResizeImage-function, which looks like this;

A picture named M5

The code above calls the II2LN_Resize function to do the resize there if II2LN is installed. If not, the ordinary JAVA_Resize is called.

How do you get II2LN?

Simple, just head over to http://www.vcode.no/ii2ln and follow the links to download-page. Download the installer and install II2LN locally on your machine. II2LN require a registration key to operate without stamping all images with a logo. However, it is possible from release 1.6.0.0 of II2LN to install the Blogsphere II2LN key by simply by specifying the parameter /BLOGSPHERE to the installer. If you have multiple Notes clients installed, then the installer will attempt to install II2LN on the selectable clients. However, due to the fact that there are many ways to install multiple Notes clients, the installer sometimes fails. If that happens for you, please check out the User's Guide which is included in the installer.

Other cool things to do with II2LN

II2LN can process the images in a multitude of ways, such as rotating, resizing, sharpen, blur etc. Additionally you can overlay text and images (easy to create watermarks on all images ). All these possibilities are described in detail in the User's Guide. The II2LN_Resize function contains some code which checks for a couple of Notes.ini keywords. Since the import options basically is a string passed onto the function ProcessImage, you can add prefix-import options with the II2LNPrefixImportOptions keyword, and suffix-import options with the keyword II2LNSuffixImportOptions.  The reason for having these keywords is that the Blogsphere User Interface doesn't contain any II2LN-parameters.

Calendar

Search Site

Tag Cloud

Domino BlogSphere
Version 3.0.2

A Code Snippit

The Home URL of this db is http://dev.blogsphere.net/blogsphere/bsphere3.nsf