|
|
|
May 22nd,2002.
|
TIFF Plugin For Squeak
|
This Squeak for the Macintosh plugin allows you to decode or encode Forms from/to the TIFF format. Most of the work is done by software from:
http://www.libtiff.org (for tiff)
http://www.ijg.org (for jpeg compression) (JPEGS can be embedded in TIFFs, so this is NOT a general JPEG reader, but maybe one will be forthcoming)
http://www.gzip.org/zlib/ (for zip compression)
Keep in mind your other TIFF reader software might not support zip or jpeg compression (sigh).
The Smalltalk code: a change set
The macintosh version: plugin. Toss it in the same place as your VM, or your VM plugin folder.
Since all this code was BUILT for intel machines I'm SURE someone can port the plugin to Intel and Linux based distributions. What was changed for the macintosh was to use NewPtrSys instead of malloc or cmalloc or NewPtr.
To compile the JPEG stuff I pulled the JPEG configure (jconfig.h) file from http://www.ultranet.com/~rbate/ and added #define USE_MAC_MEMMGR, then changed memory allocation to use newPtrSys in jmemmac.c
To compile the TIFF stuff I altered tif_apple.c to use newPtrSys, and added in the compression I wanted (NO LZW!) and maybe you need this silly tif_fax3sm.c file which will save you having to build it.
To compile the zlib stuff I altered zutil.c to use newPtrSys and disposePtr.
Oh and a wee bit of utility glue code changesForSqueak.c that you will need to get everything to link.
Testing? Some test images and a SUnit test suite.
Some example code:
form _ TIFFFile makeFormFrom: 'adobeGirl.tiff'.
result _ TIFFFile writeFormAsStrip: form toFile: 'foobar.tiff'.
The licences, chopped from the sources, refer to them for accuracy.
The Smalltalk code to build and use the TIFF plugin is licensed under the Squeak-L.
libtiff has the following copyright
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
zlib 1.1.3 is a general purpose data compression library.
Acknowledgments:
The deflate format used by zlib was defined by Phil Katz. The deflate
and zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib;
they are too numerous to cite here.
Copyright notice:
(C) 1995-1998 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
If you use the zlib library in a product, we would appreciate *not*
receiving lengthy legal documents to sign. The sources are provided
for free but without warranty of any kind. The library has been
entirely written by Jean-loup Gailly and Mark Adler; it does not
include third-party code.
The Independent JPEG Group's JPEG software
==========================================
For release 6b of 27-Mar-1998
1. We don't promise that this software works. (But if you find any bugs,
please let us know!)
2. You can use this software for whatever you want. You don't have to pay us.
3. You may not pretend that you wrote this software. If you use it in a
program, you must acknowledge somewhere in your documentation that
you've used the IJG code.
In legalese:
The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-1998, Thomas G. Lane.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.
These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.
Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".
We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor. |