From zsu@iii.org.tw Thu Jun 4 02:30:19 1998
From: zsu@iii.org.tw (Su, Yuan-Liang)
Date: Thu, 4 Jun 1998 09:30:19 +0800
Subject: [Image-SIG] BMP color palette bug fix
Message-ID: <002b01bd8f58$5b15c7d0$76475c8c@mercury.iii.org.tw>
This is a multi-part message in MIME format.
------=_NextPart_000_0027_01BD8F9B.63CC05E0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0028_01BD8F9B.63CC05E0"
------=_NextPart_001_0028_01BD8F9B.63CC05E0
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable
There is a bug in BmpImagePlugin.py module which is caused
by ignoring the palette size field in BMP header.
I mark the changed parts with #!+ for addition and #!* for
modification.
Su, Yuan-Liang
Institute for Infomation Industry
------=_NextPart_001_0028_01BD8F9B.63CC05E0
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable
There is a bug in =
BmpImagePlugin.py module which is=20
caused
by ignoring the =
palette size field in BMP=20
header.
I mark the changed =
parts with #!+ for addition and=20
#!* for
modification.
Su, =
Yuan-Liang
Institute for =
Infomation=20
Industry
------=_NextPart_001_0028_01BD8F9B.63CC05E0--
------=_NextPart_000_0027_01BD8F9B.63CC05E0
Content-Type: application/octet-stream;
name="BmpImagePlugin.py"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="BmpImagePlugin.py"
#
# The Python Imaging Library.
# $Id: BmpImagePlugin.py,v 1.5 1996/11/10 17:52:14 fredrik Exp $
#
# BMP file handler
#
# Windows (and OS/2) native bitmap storage format.
#
# History:
# 95-09-01 fl Created
# 96-04-30 fl Added save
#
# Copyright (c) Fredrik Lundh 1995-96. All rights reserved.
#
# See the README file for information on usage and redistribution.
#
__version__ =3D "0.1"
import array
import Image, ImageFile, ImagePalette
#
# --------------------------------------------------------------------
# Read BMP file
def i16(c):
return ord(c[0]) + (ord(c[1])<<8)
def i32(c):
return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + =
(ord(c[3])<<24)
BIT2MODE =3D {
1: ("1", "1"),
4: ("P", "P;4"),
8: ("P", "P"),
24: ("RGB", "BGR")
}
def _accept(prefix):
return prefix[:2] =3D=3D "BM"
class BmpImageFile(ImageFile.ImageFile):
format =3D "BMP"
format_description =3D "Windows Bitmap"
def _bitmap(self, header =3D 0, offset =3D 0):
if header:
self.fp.seek(header)
# CORE/INFO
s =3D self.fp.read(4)
s =3D s + self.fp.read(i32(s)-4)
colors =3D 0
if len(s) =3D=3D 12:
# OS/2 1.0 CORE
bits =3D i16(s[10:])
self.size =3D i16(s[4:]), i16(s[6:])
lutsize =3D 3
elif len(s) in [40, 64]:
# WIN 3.1 or OS/2 2.0 INFO
bits =3D i16(s[14:])
self.size =3D i32(s[4:]), i32(s[8:])
self.info["compression"] =3D i32(s[16:])
#!+ Su, Yuan-Liang
colors =3D i32(s[32:])
#!!
lutsize =3D 4
else:
raise IOError, "Unknown BMP header type"
# MODE
try:
self.mode, rawmode =3D BIT2MODE[bits]
except KeyError:
raise IOError, "Unsupported BMP pixel depth"
# LUT
if self.mode !=3D "RGB":
#!* Su, Yuan-Liang
if colors =3D=3D 0:
colors =3D 1<>3)&(-4), -1))]
def _open(self):
# HEAD
s =3D self.fp.read(14)
if s[:2] !=3D "BM":
raise SyntaxError, "Not a BMP file"
offset =3D i32(s[10:])
#!* Su, Yuan-Liang
self._bitmap(0, offset)
#!!
#
# --------------------------------------------------------------------
# Write BMP file
def o16(i):
return chr(i&255) + chr(i>>8&255)
def o32(i):
return chr(i&255) + chr(i>>8&255) + chr(i>>16&255) + chr(i>>24&255)
def _save(im, fp, filename):
if im.mode =3D=3D "1":
rawmode, bits, colors =3D "1I", 1, 2
elif im.mode in ["L", "P"]:
rawmode, bits, colors =3D "L", 8, 256
elif im.mode =3D=3D "RGB":
rawmode, bits, colors =3D "BGR", 24, 0
else:
raise IOError, "cannot write mode %s as BMP" % im.mode
stride =3D ((im.size[0]*bits+7)/8+3)&-4
header =3D 40 # or 64 for OS/2 version 2
offset =3D 14 + header + colors * 4
image =3D stride * im.size[1]
# bitmap header
fp.write("BM" + # file type (magic)
o32(offset+image) + # file size
o32(0) + # reserved
o32(offset)) # image data offset
# bitmap info header
fp.write(o32(header) + # info header size
o32(im.size[0]) + # width
o32(im.size[1]) + # height
o16(1) + # planes
o16(bits) + # depth
o32(0) + # compression (0=3Duncompressed)
o32(image) + # size of bitmap
o32(1) + o32(1) + # resolution
o32(colors) + # colors used
o32(colors)) # colors important
fp.write("\000" * (header - 40)) # padding (for OS/2 format)
if im.mode =3D=3D "1":
for i in (0, 255):
fp.write(chr(i) * 4)
elif im.mode =3D=3D "L":
for i in range(256):
fp.write(chr(i) * 4)
elif im.mode =3D=3D "P":
fp.write(im.im.getpalette("BGRX"))
ImageFile._save(im, fp, [("raw", (0,0)+im.size, 0, (rawmode, stride, =
-1))])
#
# --------------------------------------------------------------------
# Registry
Image.register_open(BmpImageFile.format, BmpImageFile, _accept)
Image.register_save(BmpImageFile.format, _save)
Image.register_extension(BmpImageFile.format, ".bmp")
------=_NextPart_000_0027_01BD8F9B.63CC05E0--
From Fred L. Drake, Jr."
The patch below should be applied to the file Grail/pil_interface.py
in the PIL distribution. This removes the bogus highlight border
around the label used to hold the image, makes some adjustments to the
contents of the label before the image is ready, and removes the
timing printouts: I don't think anyone doubts that PIL is a lot
faster!
-Fred
--
Fred L. Drake, Jr.
Corporation for National Research Initiatives
1895 Preston White Dr. Reston, VA 20191
*** pil_interface.py.dist Sun Dec 8 10:00:23 1996
--- pil_interface.py Thu Jun 4 11:14:12 1998
***************
*** 6,16 ****
# pil_interface.py -- a PIL interface for Grail
#
- # Notes:
- # You may wish to remove the print statements in here. They
- # are included only to show you that PIL is pretty fast compared
- # to everything else...
- #
# History:
# 96-04-18 fl Created
#
--- 6,13 ----
# pil_interface.py -- a PIL interface for Grail
#
# History:
# 96-04-18 fl Created
+ # 98-06-04 fld Made minimal changes to look better with current
+ # Grail implementation; removed timimg display.
#
***************
*** 36,47 ****
self.viewer = viewer
self.viewer.new_font((AS_IS, AS_IS, AS_IS, 1))
! self.label = Tkinter.Label(self.viewer.text, text = "")
self.viewer.add_subwindow(self.label)
self.buf = []
- global t
- t = time.time()
- print "** GRAIL", time.time() - t
-
def feed(self, data):
try:
--- 33,42 ----
self.viewer = viewer
self.viewer.new_font((AS_IS, AS_IS, AS_IS, 1))
! self.label = Tkinter.Label(self.viewer.text, text="",
! background=viewer.text.cget("background"),
! highlightthickness=0)
self.viewer.add_subwindow(self.label)
self.buf = []
def feed(self, data):
try:
***************
*** 57,61 ****
if self.buf:
try:
- print "** PIL", time.time() - t
self.buf = string.joinfields(self.buf, "")
im = Image.open(StringIO.StringIO(self.buf))
--- 52,55 ----
***************
*** 64,70 ****
tkim.paste(im)
self.label.image = tkim.image
- print "** TK", time.time() - t
self.label.config(image = self.label.image)
- print "** OK", time.time() - t
except:
self.broken = 1
--- 58,62 ----
From Fred L. Drake, Jr."
In April, 1997, I posted an image_gif.py for Grail that used PIL to
load GIFs and support animation if present in the GIF. This version
uses PIL only if available and Tk if not, so it will replace the old
image_gif.py in the next Grail. In the meanwhile, it can be dropped
in place of the old one.
To use PIL, it requires the pil_interface.py module from PIL; see
the docstring at the top of the module.
It also supports looping of animations, which the older version did
not.
(Fredrik: feel free to include this in the Grail/ directory of
future PIL distributions!)
-Fred
--
Fred L. Drake, Jr.
Corporation for National Research Initiatives
1895 Preston White Dr. Reston, VA 20191
"""image/gif document handling for Grail.
This supports both plain Tk support and PIL-enhanced support. When PIL is
available and the line
browser--enable-pil: 1
is located in the ~/.grail/grail-preferences file, PIL will be used and can
support animation of GIF89a files as well as single-frame display. We still
need a way for the user to STOP the animation!
The files Grail/*.py from the PIL distribution should be installed in the
same directory as this file.
"""
import AsyncImage
import grailutil
import os
import string
import sys
import tempfile
import Tkinter
from formatter import AS_IS
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
ERROR_FILE = os.path.join("icons", "sadsmiley.gif")
class pil_interface:
"""Dummy class to keep us from having to define PILGifParser within a
try/except construct."""
pass
try:
import Image
import ImageTk
from pil_interface import pil_interface
except ImportError:
_use_pil = 0
else:
_use_pil = 1
class PILGifParser(pil_interface):
im = None
currentpos = 0
duration = 0
loop = 0
def close(self):
if self.buf:
try:
self.label.config(text="")
self.label.update_idletasks()
data = string.joinfields(self.buf, "")
self.buf = None
self.im = im = Image.open(StringIO(data))
im.load()
self.tkim = tkim = ImageTk.PhotoImage(im.mode, im.size)
tkim.paste(im)
self.label.image = tkim.image
self.label.config(image=self.label.image)
if im.info.has_key("duration"):
self.duration = im.info["duration"]
if im.info.has_key("loop"):
self.duration = self.duration or 100
self.loop = im.info["loop"]
self.data = data
if self.duration or self.loop:
self.viewer.register_reset_interest(self.cancel_loop)
self.after_id = self.label.after(self.duration,
self.next_image)
except:
self.broken = 1
stdout = sys.stdout
try:
sys.stdout = sys.stderr
print "Error decoding image:"
print sys.exc_type + ":", sys.exc_value
finally:
sys.stdout = stdout
if self.broken:
self.label.image = Tkinter.PhotoImage(
file=grailutil.which(ERROR_FILE))
self.label.config(image = self.label.image)
self.viewer.text.insert(Tkinter.END, '\nBroken Image!')
def next_image(self):
newpos = self.currentpos + 1
try:
self.im.seek(newpos)
except (ValueError, EOFError):
if self.loop:
self.reset_loop()
else:
self.viewer.unregister_reset_interest(self.cancel_loop)
return
else:
self.currentpos = newpos
self.tkim.paste(self.im)
self.after_id = self.label.after(self.duration, self.next_image)
def reset_loop(self):
im = Image.open(StringIO(self.data))
im.load()
self.tkim.paste(im)
self.im = im
self.currentpos = 0
def cancel_loop(self, *args):
self.viewer.unregister_reset_interest(self.cancel_loop)
self.label.after_cancel(self.after_id)
class TkGifParser:
"""Parser for image/gif files.
Collect all the data on a temp file and then create an in-line
image from it.
"""
def __init__(self, viewer, reload=0):
self.tf = self.tfname = None
self.viewer = viewer
self.viewer.new_font((AS_IS, AS_IS, AS_IS, 1))
self.tfname = tempfile.mktemp()
self.tf = open(self.tfname, 'wb')
self.label = Tkinter.Label(self.viewer.text, text=self.tfname,
highlightthickness=0, borderwidth=0)
self.viewer.add_subwindow(self.label)
def feed(self, data):
self.tf.write(data)
def close(self):
if self.tf:
self.tf.close()
self.tf = None
self.label.image = Tkinter.PhotoImage(file=self.tfname)
self.label.config(image=self.label.image)
if self.tfname:
try:
os.unlink(self.tfname)
except os.error:
pass
def parse_image_gif(*args, **kw):
"""Create the appropriate image handler, and replace this function with
the handler for future references (to skip the determination step)."""
global parse_image_gif
if _use_pil and AsyncImage.isPILAllowed():
parse_image_gif = PILGifParser
else:
parse_image_gif = TkGifParser
return apply(parse_image_gif, args, kw)
From Fred L. Drake, Jr."
--uOKuwXZqyz
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Here's a new version of the image/gif (document) support; it turns
out I was using an old version of the ImageTk.py file from PIL, and
relied on an attribute that's no longer there. Please use this
version instead.
This version still requires the pil_interface.py file from PIL's
Grail/ directory to be importable; I intend to remove this requirement
in the future (before a new Grail is released, certainly!). I don't
know when I'll get to support inline animations, but that would be
somewhat useful, I think. But I won't add that until I also add the
"Stop animations..." and "Stop this animation" operations! ;-)
-Fred
--
Fred L. Drake, Jr.
Corporation for National Research Initiatives
1895 Preston White Dr. Reston, VA 20191
--uOKuwXZqyz
Content-Type: text/x-python
Content-Description: image/gif document support for Grail
Content-Disposition: inline;
filename="image_gif.py"
Content-Transfer-Encoding: 7bit
# Copyright (c) CNRI 1996-1998, licensed under terms and conditions of
# license agreement obtained from handle "hdl:cnri/19980302135001",
# URL "http://grail.cnri.reston.va.us/LICENSE-0.4/", or file "LICENSE".
"""image/gif document handling for Grail.
This supports both plain Tk support and PIL-enhanced support. When PIL is
available and the line
browser--enable-pil: 1
is located in the ~/.grail/grail-preferences file, PIL will be used and can
support animation of GIF89a files as well as single-frame display. We still
need a way for the user to STOP the animation!
The files Grail/*.py from the PIL distribution should be installed in the
same directory as this file.
"""
import AsyncImage
import grailutil
import os
import string
import sys
import tempfile
import Tkinter
from formatter import AS_IS
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
ERROR_FILE = os.path.join("icons", "sadsmiley.gif")
class pil_interface:
"""Dummy class to keep us from having to define PILGifParser within a
try/except construct."""
pass
try:
import Image
import ImageTk
from pil_interface import pil_interface
except ImportError:
_use_pil = 0
else:
_use_pil = 1
class PILGifParser(pil_interface):
im = None
currentpos = 0
duration = 0
loop = 0
def close(self):
if self.buf:
self.label.config(text="")
self.label.update_idletasks()
data = string.joinfields(self.buf, "")
self.buf = None # free lots of memory!
try:
self.im = im = Image.open(StringIO(data))
im.load()
self.tkim = tkim = ImageTk.PhotoImage(im.mode, im.size)
tkim.paste(im)
except:
# XXX What was I trying to catch here?
# I think (EOFError, IOError).
self.broken = 1
stdout = sys.stdout
try:
sys.stdout = sys.stderr
print "Error decoding image:"
print str(sys.exc_type) + ":", sys.exc_value
finally:
sys.stdout = stdout
else:
self.label.config(image=tkim)
if im.info.has_key("duration"):
self.duration = im.info["duration"]
if im.info.has_key("loop"):
self.duration = self.duration or 100
self.loop = im.info["loop"]
self.data = data
if self.duration or self.loop:
self.viewer.register_reset_interest(self.cancel_loop)
self.after_id = self.label.after(self.duration,
self.next_image)
if self.broken:
self.label.image = Tkinter.PhotoImage(
file=grailutil.which(ERROR_FILE))
self.label.config(image = self.label.image)
self.viewer.text.insert(Tkinter.END, '\nBroken Image!')
def next_image(self):
newpos = self.currentpos + 1
try:
self.im.seek(newpos)
except (ValueError, EOFError):
# past end of animation
if self.loop:
self.reset_loop()
else:
# all done
self.viewer.unregister_reset_interest(self.cancel_loop)
return
else:
self.currentpos = newpos
self.tkim.paste(self.im)
self.after_id = self.label.after(self.duration, self.next_image)
def reset_loop(self):
im = Image.open(StringIO(self.data))
im.load()
self.tkim.paste(im)
self.im = im
self.currentpos = 0
def cancel_loop(self, *args):
self.viewer.unregister_reset_interest(self.cancel_loop)
self.label.after_cancel(self.after_id)
class TkGifParser:
"""Parser for image/gif files.
Collect all the data on a temp file and then create an in-line
image from it.
"""
def __init__(self, viewer, reload=0):
self.tf = self.tfname = None
self.viewer = viewer
self.viewer.new_font((AS_IS, AS_IS, AS_IS, 1))
self.tfname = tempfile.mktemp()
self.tf = open(self.tfname, 'wb')
self.label = Tkinter.Label(self.viewer.text, text=self.tfname,
highlightthickness=0, borderwidth=0)
self.viewer.add_subwindow(self.label)
def feed(self, data):
self.tf.write(data)
def close(self):
if self.tf:
self.tf.close()
self.tf = None
self.label.image = Tkinter.PhotoImage(file=self.tfname)
self.label.config(image=self.label.image)
if self.tfname:
try:
os.unlink(self.tfname)
except os.error:
pass
def parse_image_gif(*args, **kw):
"""Create the appropriate image handler, and replace this function with
the handler for future references (to skip the determination step)."""
global parse_image_gif
if _use_pil and AsyncImage.isPILAllowed():
parse_image_gif = PILGifParser
else:
parse_image_gif = TkGifParser
return apply(parse_image_gif, args, kw)
--uOKuwXZqyz--
From 1919dd@sprint.com Sun Jun 14 03:40:32 1998
From: 1919dd@sprint.com (1919dd)
Date: Sun, 14 Jun 1998 11:40:32 +0900 (JST)
Subject: No subject
Message-ID: <19943672.886214@relay.comanche.denmark.eu> Monday, June 15th, 1998
Authenticated sender is <1919dd@sprint.com>
Subject: 1
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
EMAIL MARKETING WORKS!!
Bull's Eye Gold is the PREMIER email address collection tool.
This program allows you to develop TARGETED lists of email
addresses. Doctors, florists, MLM, biz opp,...you can collect
anything...you are only limited by your imagination! You can
even collect email addresses for specific states, cities, and
even countries! All you need is your web browser and this program.
Our software utilizes the latest in search technology called
"spidering". By simply feeding the spider program a starting
website it will collect for hours. The spider will go from website
to targeted website providing you with thousands upon thousands of
fresh TARGETED email addresses. When you are done collecting, the
spider removes duplicates and saves the email list in a ready to
send format. No longer is it necessary to send millions of ads to
get a handful of responses...SEND LESS...EARN MORE!!!
A terrific aspect of the Bull's Eye software is that there is
no difficult set up involved and no special technical mumbo-jumbo
to learn. All you need to know is how to search for your targeted
market in one of the many search engines and let the spider do the
rest! Not familiar with the search engines? No problem, we provide
you with a list of all the top search engines. Just surf to the
location of a search engine on your browser then search for the
market you wish to reach...it's that easy!
For instance if you were looking for email addresses of Doctors
in New York all you would do is:
1) Do a search using your favorite search engine by typing in
the words doctor(s) and New York
2) Copy the URL (one or more)...that's the stuff after the
http://... for instance it might look like
http://www.yahoo.com/?doctor(s)/?New+York
3) Press the START button
THAT's IT!!! The Bull's Eye spider will go to all the websites
that are linked, automatically extracting the email addresses
you want.
The spider is passive too! That means you can let it run all
day or all night while you are working on important things or
just having fun on your computer. There is no need to keep a
constant watch on it, just feed it your target market and give
it praise when it delivers thousands of email addresses at
the end of the day!
Features of the Bull's Eye Software:
* Does TARGETED searches of websites collecting the email
addresses you want!
* Collects Email addresses by City, State, even specific
Countries
* Runs Automatically...simply enter the Starting information,
press The Start Button, and it does the rest
* Filters out duplicates
* Keeps track of URLs already visited
* Can run 24 hours per day, 7 days per week
* Fast and Easy List Management
* Also has built in filtering options...you can put in words
that it "Must" have while searching,...you can even put in
criteria that it "Must NOT Have"...giving you added flexibility
* Also imports email addresses from any kind of files (text
files, binary files, database files)
* List editor handles Multiple files to work on many lists
simultaneously
* Has a Black-Book feature... avoid sending emails to people
who do not want to receive it
* Built-in Mail program...send email directly on the internet
with just a click of your mouse
* Personalized Emails...if the email address has the user's
name when it is collected,..you can send Personalized emails!!!
* Sort by Location, Server, User Name, Contact Name
* Advanced Operations:
· Email address lists export in many different formats
(HTML, Comma delimited, text file)
· Advanced editing...Transfer, Copy, Addition, Delete, Crop,
Move to Top/Bottom
· Operations between lists...Union, Subtraction, Comparison
* Program is Passive,...meaning you can run other programs at
the same time
CALL FOR MORE INFORMATION 213-969-4930
CALL FOR MORE INFORMATION 213-969-4930
ORDERING INFORMATION
Customer Name
Company Name
Address
City
State Zip
Phone Fax
Email Address
______ BULL'S EYE SOFTWARE $259.00
Includes Software, Instructions, Technical Support
______ Shipping & Handling (2-3 Day Fedex) $10.00
(Fedex Overnite) $20.00
______ TOTAL
(CA Residents add applicable sales tax)
*All orders are for Win 95 and Win NT
*****CREDIT CARDS ACCEPTED*****
MASTERCARD VISA AMEX
PLEASE CALL 213-969-4930 to process your order
9am-5pm Pacific Time
Checks or Money Orders send to:
WorldTouch Network Inc.
5670 Wilshire Blvd. Suite 2170 Los Angeles, CA 90036
Please note: Allow 5 business days for all checks to
clear before order is shipped.
From image_sig@opti.okdirect.com Fri Jun 26 01:30:02 1998
From: image_sig@opti.okdirect.com (Daniel Walton)
Date: Thu, 25 Jun 1998 19:30:02 -0500
Subject: [Image-SIG] Lost JPEG decoder
Message-ID: <3.0.5.32.19980625193002.0111bba0@okdirect.com>
Howdy! I just installed PIL 0.3a4 on a FreeBSD system and am having
problems getting the JPG decoder to work. I installed the IJG KPEG library
version 6b on the system already and it is located in
/usr/local/lib/libjpeg.a as well as /usr/local/lib/libjpeg.so.6.0 ...
The Setup file for PIL has the following line and *noconfig* is not
commented out:
_imaging _imagingmodule.c decode.c encode.c display.c path.c -IlibImaging
libImaging/libImaging.a -I/usr/local/include -L/usr/local/lib -ljpeg
-I/usr/local/include -L/usr/local/lib -lz
The tests seem to run fine however when building the core library the test
fails because I don't have xv installed.
After compilation I can import _imaging and Image just fine and started to
go through the tutorial when I ran into a problem trying to resize a jpg
image. Here's the scoup:
Python 1.5 (#3, May 15 1998, 00:31:58) [GCC 2.6.3] on freebsd2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import Image
>>> im = Image.open('airshow.jpg')
>>> im.format
'JPEG'
>>> im.size
(500, 339)
>>> im.mode
'RGB'
>>> im.resize( (128,128) )
Traceback (innermost last):
File "", line 1, in ?
File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 507, in
resize
self.load()
File "/usr/local/lib/python1.5/site-packages/PIL/ImageFile.py", line 136,
in load
d = Image._getdecoder(d, e, a, self.decoderconfig)
File "/usr/local/lib/python1.5/site-packages/PIL/Image.py", line 160, in
_getdecoder
raise IOError, "decoder %s not available" % d
IOError: decoder jpeg not available
>>> ls -l /usr/home/dan/pil
Traceback (innermost last):
File "", line 1, in ?
NameError: ls
>>>
Does anyone have any clues that might help out in findind my lost jpeg
decoder? If there is any information that I can provide to help, just let
me know. I am trying to get PIL going in order to create JPEG images for a
website.
Thanks!
Daniel Walton
From da@skivs.ski.org Fri Jun 26 01:55:54 1998
From: da@skivs.ski.org (David Ascher)
Date: Thu, 25 Jun 1998 17:55:54 -0700 (PDT)
Subject: [Image-SIG] not really PIL related...
Message-ID:
I've been looking for programs to convert truetype fonts to either type1
fonts or wrap them in Type 42. I *know* there are such programs out
there, but none of the web searching techniques I know yielded anything.
Anyone?
ObPIL: PIL is still cool.
From lorenzo@argon.roma2.infn.it Fri Jun 26 12:25:00 1998
From: lorenzo@argon.roma2.infn.it (Lorenzo M. Catucci)
Date: Fri, 26 Jun 1998 13:25:00 +0200 (CEST)
Subject: [Image-SIG] Integration with the main distribution
Message-ID:
Dear all (and most dear /F),
I see pil is some way starving from opal taking away the best
energies here, and still, I come with just another suggestion/request: as
a matter of fact, anytime we rebuild python's main set, we need to rebuild
a patched _tkinter too, and _tkinter.c gets references into PIL's
headers... Now, I think there should be a way to effectively decouple PIL
from the main distribution (or, really, build in plugs in the latter), so
that the standard _tkinter could be able to deal with PIL's images as soon
as you compile the PIL modules set, instead of forcing you to build and
install a new _tkinter anytime /F updates PIL. Any hope?
Eagerly waiting for a 0.4 release, with full tiff support, yours
lorenzo
From fredrik@pythonware.com Fri Jun 26 13:51:01 1998
From: fredrik@pythonware.com (Fredrik Lundh)
Date: Fri, 26 Jun 1998 13:51:01 +0100
Subject: [Image-SIG] Integration with the main distribution
Message-ID: <037601bda101$12a5fff0$f29b12c2@pythonware.com>
>I see pil is some way starving from opal taking away the best
>energies here
Well, we do have a 0.3b (the one and only beta) up and running;
it's being tested together with Garnet #3, and will ship as soon as
G3 is out (see our site for more info).
>as a matter of fact, anytime we rebuild python's main set, we need to
>rebuild a patched _tkinter too, and _tkinter.c gets references into PIL's
>headers... Now, I think there should be a way to effectively decouple PIL
>from the main distribution (or, really, build in plugs in the latter), so
>that the standard _tkinter could be able to deal with PIL's images as soon
>as you compile the PIL modules set, instead of forcing you to build and
>install a new _tkinter anytime /F updates PIL. Any hope?
well, you don't really have to rebuild _tkinter everytime we release
a new PIL; in fact, there has been only one such change since release
0.1. so if the README doesn't say anything else, you should be able
to just upgrade the _imaging module.
but we have a better solution coming up -- a solution where you don't
need to create a special _tkinter version at all (*). it may not make it
into 0.3b, but hopefully to the final release.
Cheers /F
fredrik@pythonware.com
http://www.pythonware.com
*) for best performance, you should probably apply our Tk patches
anyway...
From fredrik@pythonware.com Fri Jun 26 13:56:56 1998
From: fredrik@pythonware.com (Fredrik Lundh)
Date: Fri, 26 Jun 1998 13:56:56 +0100
Subject: [Image-SIG] Lost JPEG decoder
Message-ID: <038e01bda101$e69efbe0$f29b12c2@pythonware.com>
>Howdy! I just installed PIL 0.3a4 on a FreeBSD system and am having
>problems getting the JPG decoder to work. I installed the IJG KPEG library
>version 6b on the system already and it is located in
>/usr/local/lib/libjpeg.a as well as /usr/local/lib/libjpeg.so.6.0 ...
When you build libImaging.a, make sure that the ./configure
script really managed to find your library
-- if it says "yes" when you run it, everything's fine (but I don't
think it does)
-- if not, check the config.log file for details. if you cannot work
around this, you have to edit ImConfig.h by hand to enable JPEG
support in libImaging
>>>> im = Image.open('airshow.jpg')
This doesn't require the JPEG library...
>>>> im.format
>'JPEG'
>>>> im.size
>(500, 339)
>>>> im.mode
>'RGB'
>>>> im.resize( (128,128) )
but this one does: the raster data isn't read until you try to
do something with it...
>IOError: decoder jpeg not available
and this means that libImaging wasn't compiled with JPEG
support...
Cheers /F
fredrik@pythonware.com
http://www.pythonware.com
From lorenzo@argon.roma2.infn.it Fri Jun 26 12:55:02 1998
From: lorenzo@argon.roma2.infn.it (Lorenzo M. Catucci)
Date: Fri, 26 Jun 1998 13:55:02 +0200 (CEST)
Subject: [Image-SIG] Re: Re: [Image-SIG] Integration with the main distribution
In-Reply-To: <037601bda101$12a5fff0$f29b12c2@pythonware.com>
Message-ID:
On Fri, 26 Jun 1998, Fredrik Lundh wrote:
> Well, we do have a 0.3b (the one and only beta) up and running;
> it's being tested together with Garnet #3, and will ship as soon as
> G3 is out (see our site for more info).
>
Nice to know...
>
> but we have a better solution coming up -- a solution where you don't
> need to create a special _tkinter version at all (*). it may not make it
> into 0.3b, but hopefully to the final release.
[...]
> *) for best performance, you should probably apply our Tk patches
> anyway...
>
As always, I haven't been clear: my mail was more of a plug for your
changes to get into python's main _tkinter, than for _imaging to get less
performing connections to a general _tkinter; I really don't understand
what happens in PIL's headers, but I was hoping the relevant part for
tkinter could be decoupled from their mains, and go into python...
Have a good day, and sorry for being noisy...
Yours,
l.
From image_sig@opti.okdirect.com Fri Jun 26 21:05:39 1998
From: image_sig@opti.okdirect.com (Daniel Walton)
Date: Fri, 26 Jun 1998 15:05:39 -0500
Subject: [Image-SIG] Lost JPEG decoder
Message-ID: <3.0.5.32.19980626150539.00e283b0@okdirect.com>
At 01:56 PM 6/26/98 +0100, you wrote:
>When you build libImaging.a, make sure that the ./configure
>script really managed to find your library
>
>-- if it says "yes" when you run it, everything's fine (but I don't
> think it does)
>-- if not, check the config.log file for details. if you cannot work
> around this, you have to edit ImConfig.h by hand to enable JPEG
> support in libImaging
>
This must be where things are going wrong. I changed the ImConfig.h such
that HAVE_LIBJPEG was defined but when I do a make it comes up with the
following errors:
gcc -O -I./. -I/usr/local/include -DHAVE_CONFIG_H -c JpegDecode.c
JpegDecode.c:38: parse error before `void'
JpegDecode.c:44: parse error before `boolean'
JpegDecode.c:51: parse error before `void'
JpegDecode.c:92: parse error before `void'
JpegDecode.c:96: `cinfo' undeclared here (not in a function)
JpegDecode.c:96: warning: data definition has no type or storage class
JpegDecode.c:98: parse error before `->'
JpegDecode.c:98: conflicting types for `longjmp'
/usr/include/setjmp.h:84: previous declaration of `longjmp'
JpegDecode.c:98: warning: data definition has no type or storage class
JpegDecode.c: In function `ImagingJpegDecode':
JpegDecode.c:123: warning: assignment makes pointer from integer without a
cast
*** Error code 1
Stop.
If I were much of a C guru I would do my best to debug it, but
unfortunately I'm not. I have the jpeg libraries installed. A listing of
/usr/local/lib shows libjpeg.a and libjpeg.so.6.0 ... The
libImaging/configure script didn't find them apparently. Interesting
thing, if I run the configure script it has the yes/no answers (JPEG is
"(cached) no") but the config.log only has the checking information.
Your help is greatly appreciated!
Daniel Walton
From da@skivs.ski.org Fri Jun 26 23:12:53 1998
From: da@skivs.ski.org (David Ascher)
Date: Fri, 26 Jun 1998 15:12:53 -0700 (PDT)
Subject: [Image-SIG] font problems
Message-ID:
I'm confused about PIL fonts again. I got a BDF font, converted it to
.pil/.pbm files with bdf2pil.py, and I'm trying to use it with:
from Image import *
import ImageFont
from ImageDraw import *
f = ImageFont.load('test.pil')
x = new("L", (400,400))
d = ImageDraw(x)
d.setfont(f)
d.text((50, 50), 'this is a Test!')
x.save('test.jpg')
Alas, I get:
Traceback (innermost last):
File "test.py", line 9, in ?
d.text((50, 50), 'this is a Test!')
File "E:\DAVID\py\PIL\ImageDraw.py", line 71, in text
m = self.font.getmask(text)
File "E:\DAVID\py\PIL\ImageFont.py", line 87, in getmask
im.im.paste(self.image.im.crop(tuple(m[6:10])),
SystemError: NULL result without error in call_object
Any ideas?
Looking at the ImagingCrop code, nothing jumps out. (although I wouldn't
mind seeing real error messages, not just 'return NULL'. =).
--david
From da@skivs.ski.org Fri Jun 26 23:39:33 1998
From: da@skivs.ski.org (David Ascher)
Date: Fri, 26 Jun 1998 15:39:33 -0700 (PDT)
Subject: [Image-SIG] fixed it
Message-ID:
FYI,
I found that I needed to modify a "1" to "L" in ImageFont.py.
From Anthony Baxter Sun Jun 28 08:38:22 1998
From: Anthony Baxter (Anthony Baxter)
Date: Sun, 28 Jun 1998 17:38:22 +1000
Subject: [Image-SIG] fixed it
In-Reply-To: Your message of "Fri, 26 Jun 1998 15:39:33 MST."
Message-ID: <199806280739.RAA21158@koro.off.connect.com.au>
>>> David Ascher wrote
> I found that I needed to modify a "1" to "L" in ImageFont.py.
Is this at the start of ImageFont.ImageFont().getmask()? That's the only
one I can see... (I noticed this bug a while ago, but had no time to
even start looking for it)
From da@skivs.ski.org Sun Jun 28 19:04:44 1998
From: da@skivs.ski.org (David Ascher)
Date: Sun, 28 Jun 1998 11:04:44 -0700 (PDT)
Subject: [Image-SIG] fixed it
In-Reply-To: <199806280739.RAA21158@koro.off.connect.com.au>
Message-ID:
On Sun, 28 Jun 1998, Anthony Baxter wrote:
> >>> David Ascher wrote
> > I found that I needed to modify a "1" to "L" in ImageFont.py.
>
> Is this at the start of ImageFont.ImageFont().getmask()? That's the only
> one I can see... (I noticed this bug a while ago, but had no time to
> even start looking for it)
I believe so (don't have the fixed version in front of me right now).
It's nice not to have to save, run mogrify -edit 'text ...', and reload
just to add a bit of text to an image =).
--david