[ python-Bugs-900949 ] plat-mac/videoreader.py not working on OS X
SourceForge.net
noreply at sourceforge.net
Fri Feb 20 03:52:02 EST 2004
Bugs item #900949, was opened at 2004-02-20 08:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=900949&group_id=5470
Category: Macintosh
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Dinu C. Gherman (dinu_gherman)
Assigned to: Jack Jansen (jackjansen)
Summary: plat-mac/videoreader.py not working on OS X
Initial Comment:
plat-mac/videoreader.py uses modules like "img" which
used to be in Mac OS 9 builds, but are no longer in OS X
builds. I suggest replacing the pieces with code writing
images using PIL, if available.
The critical new pieces (whithout checks for PIL) in methods
ReadVideo/_getpixmapcontent are:
#-----------------------------
from PIL import Image
...
# convert from ARGB to RGBA (faster/better anyone?)
data = []
for i in xrange(0, width*height*4, 4):
a, r, g, b = rv[i:i+4]
data.append(r + g + b + a)
data = ''.join(data)
# save image using PIL
img = Image.fromstring("RGBA", (width, height), data)
img.save(<<some filename>>+".jpg", "JPEG")
#-----------------------------
See also my posting on the pythonmac list and its attached
script:
http://mail.python.org/pipermail/pythonmac-sig/2004-
February/010282.html
or see the attached file (which does not do exactly the same
as videoreader.py!)...
Dinu
PS: This is on Py 2.3.3 on Mac OS X 10.2.8...
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=900949&group_id=5470
More information about the Python-bugs-list
mailing list