VASmalltalk – FreeImage wrapper and Linux

I’ve uploaded version 0.8 of the FreeImage library wrapper to vastgoodies– now with partial Linux support. Changes had only to be done to use correct methods on both platforms, platform dependent subapplication management and all that stuff.

Partial Linux support means, that the API wrapper calls seem to work (e.g. creating multi page tiff files and that stuff is working) – but I have difficulties to show such a bitmap in a GUI. All my graphics are black – and I’ve no idea (up to now) what it is.

So for users: you may load pictures under Linux, do rotation, filtering, resizing whatever you want – but you will not be able to show the results in the gui. Of couse you may save the image to file and then load it using the default VA way … but again: this is only a problem under Linux and NOT under Windows.

Initial tests and a simple image viewer is now also available in the repository (actually my test application).

Under Windows FreeImage is at level 3.14.1 – under Ubuntu (10.10) you work with 3.13.1. The FreeImage library is available from the normal package repository of Ubuntu and can be installed without any problems.

Some people asks for multi page tiff support. The following code (fromthe example viewer) creates a multi-page tiff file from the actually loaded image – 16 images each slightly rotated (appData is the part containing the image).

| aMSKFIBitmap aMSKFIMulitPageBitmap |
aMSKFIMulitPageBitmap := MSKFreeImageLibraryWrapper Default 
                                         apiOpenMultiBitmap: FIF_TIFF 
                                         filename: 'multibitmap.tif' 
                                         createNew: true 
                                         readOnly: false 
                                         inMemory: false 
                                         flags: 0.
MSKFreeImageLibraryWrapper Default 
  apiAppendPage: appData value originalImage 
  inMultiBitmap: aMSKFIMulitPageBitmap.
10 to: 90 by: 5 do: [ :angle |
  aMSKFIBitmap := MSKFreeImageLibraryWrapper Default 
                             apiRotate: appData value originalImage 
                             angle: angle asFloat 
                             backgroundColor: nil.	
  MSKFreeImageLibraryWrapper Default
    apiAppendPage: aMSKFIBitmap
    inMultiBitmap: aMSKFIMulitPageBitmap.
MSKFreeImageLibraryWrapper Default 
  apiCloseMultiBitmap: aMSKFIMulitPageBitmap  
  flags: 0.
This entry was posted in Smalltalk and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s