Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dc48b744
Commit
dc48b744
authored
May 20, 2007
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the rgbimg module. It has been deprecated since Python 2.5.
parent
8d76cca0
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
14 additions
and
943 deletions
+14
-943
Doc/Makefile.deps
Doc/Makefile.deps
+0
-1
Doc/lib/lib.tex
Doc/lib/lib.tex
+0
-1
Doc/lib/librgbimg.tex
Doc/lib/librgbimg.tex
+0
-54
Lib/test/regrtest.py
Lib/test/regrtest.py
+5
-1
Lib/test/test_imageop.py
Lib/test/test_imageop.py
+3
-29
Lib/test/test_rgbimg.py
Lib/test/test_rgbimg.py
+0
-70
Misc/NEWS
Misc/NEWS
+2
-0
Modules/Setup.dist
Modules/Setup.dist
+0
-1
Modules/rgbimgmodule.c
Modules/rgbimgmodule.c
+0
-780
README
README
+3
-3
setup.py
setup.py
+1
-3
No files found.
Doc/Makefile.deps
View file @
dc48b744
...
...
@@ -201,7 +201,6 @@ LIBFILES= $(MANSTYLES) $(INDEXSTYLES) $(COMMONTEX) \
lib/libimageop.tex
\
lib/libaifc.tex
\
lib/libjpeg.tex
\
lib/librgbimg.tex
\
lib/libossaudiodev.tex
\
lib/libcrypto.tex
\
lib/libhashlib.tex
\
...
...
Doc/lib/lib.tex
View file @
dc48b744
...
...
@@ -327,7 +327,6 @@ and how to embed it in other applications.
\input
{
libwave
}
\input
{
libchunk
}
\input
{
libcolorsys
}
\input
{
librgbimg
}
\input
{
libimghdr
}
\input
{
libsndhdr
}
\input
{
libossaudiodev
}
...
...
Doc/lib/librgbimg.tex
deleted
100644 → 0
View file @
8d76cca0
\section
{
\module
{
rgbimg
}
---
Read and write ``SGI RGB'' files
}
\declaremodule
{
builtin
}{
rgbimg
}
\modulesynopsis
{
Read and write image files in ``SGI RGB'' format (the module
is
\emph
{
not
}
SGI specific though!).
}
\deprecated
{
2.5
}{
This module is not maintained anymore and seems to be
unused.
}
The
\module
{
rgbimg
}
module allows Python programs to access SGI imglib image
files (also known as
\file
{
.rgb
}
files). The module is far from
complete, but is provided anyway since the functionality that there is
enough in some cases. Currently, colormap files are not supported.
\note
{
This module is only built by default for 32-bit platforms; it is
not expected to work properly on other systems.
}
The module defines the following variables and functions:
\begin{excdesc}
{
error
}
This exception is raised on all errors, such as unsupported file type, etc.
\end{excdesc}
\begin{funcdesc}
{
sizeofimage
}{
file
}
This function returns a tuple
\code
{
(
\var
{
x
}
,
\var
{
y
}
)
}
where
\var
{
x
}
and
\var
{
y
}
are the size of the image in pixels.
Only 4 byte RGBA pixels, 3 byte RGB pixels, and 1 byte greyscale pixels
are currently supported.
\end{funcdesc}
\begin{funcdesc}
{
longimagedata
}{
file
}
This function reads and decodes the image on the specified file, and
returns it as a Python string. The string has 4 byte RGBA pixels.
The bottom left pixel is the first in
the string. This format is suitable to pass to
\function
{
gl.lrectwrite()
}
,
for instance.
\end{funcdesc}
\begin{funcdesc}
{
longstoimage
}{
data, x, y, z, file
}
This function writes the RGBA data in
\var
{
data
}
to image
file
\var
{
file
}
.
\var
{
x
}
and
\var
{
y
}
give the size of the image.
\var
{
z
}
is 1 if the saved image should be 1 byte greyscale, 3 if the
saved image should be 3 byte RGB data, or 4 if the saved images should
be 4 byte RGBA data. The input data always contains 4 bytes per pixel.
These are the formats returned by
\function
{
gl.lrectread()
}
.
\end{funcdesc}
\begin{funcdesc}
{
ttob
}{
flag
}
This function sets a global flag which defines whether the scan lines
of the image are read or written from bottom to top (flag is zero,
compatible with SGI GL) or from top to bottom (flag is one,
compatible with X). The default is zero.
\end{funcdesc}
Lib/test/regrtest.py
View file @
dc48b744
...
...
@@ -1337,7 +1337,6 @@ class _ExpectedSkips:
self
.
expected
.
add
(
'test_timeout'
)
if
sys
.
maxint
==
9223372036854775807L
:
self
.
expected
.
add
(
'test_rgbimg'
)
self
.
expected
.
add
(
'test_imageop'
)
if
not
sys
.
platform
in
(
"mac"
,
"darwin"
):
...
...
@@ -1352,6 +1351,11 @@ class _ExpectedSkips:
for
skip
in
WIN_ONLY
:
self
.
expected
.
add
(
skip
)
if
sys
.
platform
!=
'irix'
:
IRIX_ONLY
=
[
"test_imageop"
]
for
skip
in
IRIX_ONLY
:
self
.
expected
.
add
(
skip
)
self
.
valid
=
True
def
isvalid
(
self
):
...
...
Lib/test/test_imageop.py
View file @
dc48b744
...
...
@@ -10,20 +10,13 @@ from test.test_support import verbose, unlink
import
imageop
,
uu
,
os
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
"the rgbimg module is deprecated"
,
DeprecationWarning
,
".*test_imageop"
)
def
main
(
use_rgbimg
=
1
):
def
main
():
# Create binary test files
uu
.
decode
(
get_qualified_path
(
'testrgb'
+
os
.
extsep
+
'uue'
),
'test'
+
os
.
extsep
+
'rgb'
)
if
use_rgbimg
:
image
,
width
,
height
=
getrgbimage
(
'test'
+
os
.
extsep
+
'rgb'
)
else
:
image
,
width
,
height
=
getimage
(
'test'
+
os
.
extsep
+
'rgb'
)
image
,
width
,
height
=
getimage
(
'test'
+
os
.
extsep
+
'rgb'
)
# Return the selected part of image, which should by width by height
# in size and consist of pixels of psize bytes.
...
...
@@ -122,23 +115,6 @@ def main(use_rgbimg=1):
# Cleanup
unlink
(
'test'
+
os
.
extsep
+
'rgb'
)
def
getrgbimage
(
name
):
"""return a tuple consisting of image (in 'imgfile' format but
using rgbimg instead) width and height"""
import
rgbimg
try
:
sizes
=
rgbimg
.
sizeofimage
(
name
)
except
rgbimg
.
error
:
name
=
get_qualified_path
(
name
)
sizes
=
rgbimg
.
sizeofimage
(
name
)
if
verbose
:
print
'rgbimg opening test image: %s, sizes: %s'
%
(
name
,
str
(
sizes
))
image
=
rgbimg
.
longimagedata
(
name
)
return
(
image
,
sizes
[
0
],
sizes
[
1
])
def
getimage
(
name
):
"""return a tuple consisting of
image (in 'imgfile' format) width and height
...
...
@@ -172,6 +148,4 @@ def get_qualified_path(name):
return
fullname
return
name
# rgbimg (unlike imgfile) is portable to platforms other than SGI.
# So we prefer to use it.
main
(
use_rgbimg
=
1
)
main
()
Lib/test/test_rgbimg.py
deleted
100644 → 0
View file @
8d76cca0
# Testing rgbimg module
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
"the rgbimg module is deprecated"
,
DeprecationWarning
,
".*test_rgbimg$"
)
import
rgbimg
import
os
,
uu
from
test.test_support
import
verbose
,
unlink
,
findfile
class
error
(
Exception
):
pass
print
'RGBimg test suite:'
def
testimg
(
rgb_file
,
raw_file
):
rgb_file
=
findfile
(
rgb_file
)
raw_file
=
findfile
(
raw_file
)
width
,
height
=
rgbimg
.
sizeofimage
(
rgb_file
)
rgb
=
rgbimg
.
longimagedata
(
rgb_file
)
if
len
(
rgb
)
!=
width
*
height
*
4
:
raise
error
,
'bad image length'
raw
=
open
(
raw_file
,
'rb'
).
read
()
if
rgb
!=
raw
:
raise
error
,
\
'images don
\
'
t match for '
+
rgb_file
+
' and '
+
raw_file
for
depth
in
[
1
,
3
,
4
]:
rgbimg
.
longstoimage
(
rgb
,
width
,
height
,
depth
,
'@.rgb'
)
os
.
unlink
(
'@.rgb'
)
table
=
[
(
'testrgb'
+
os
.
extsep
+
'uue'
,
'test'
+
os
.
extsep
+
'rgb'
),
(
'testimg'
+
os
.
extsep
+
'uue'
,
'test'
+
os
.
extsep
+
'rawimg'
),
(
'testimgr'
+
os
.
extsep
+
'uue'
,
'test'
+
os
.
extsep
+
'rawimg'
+
os
.
extsep
+
'rev'
),
]
for
source
,
target
in
table
:
source
=
findfile
(
source
)
target
=
findfile
(
target
)
if
verbose
:
print
"uudecoding"
,
source
,
"->"
,
target
,
"..."
uu
.
decode
(
source
,
target
)
if
verbose
:
print
"testing..."
ttob
=
rgbimg
.
ttob
(
0
)
if
ttob
!=
0
:
raise
error
,
'ttob should start out as zero'
testimg
(
'test'
+
os
.
extsep
+
'rgb'
,
'test'
+
os
.
extsep
+
'rawimg'
)
ttob
=
rgbimg
.
ttob
(
1
)
if
ttob
!=
0
:
raise
error
,
'ttob should be zero'
testimg
(
'test'
+
os
.
extsep
+
'rgb'
,
'test'
+
os
.
extsep
+
'rawimg'
+
os
.
extsep
+
'rev'
)
ttob
=
rgbimg
.
ttob
(
0
)
if
ttob
!=
1
:
raise
error
,
'ttob should be one'
ttob
=
rgbimg
.
ttob
(
0
)
if
ttob
!=
0
:
raise
error
,
'ttob should be zero'
for
source
,
target
in
table
:
unlink
(
findfile
(
target
))
Misc/NEWS
View file @
dc48b744
...
...
@@ -636,6 +636,8 @@ Library
Extension Modules
-----------------
- Removed the rgbimg module; been deprecated since Python 2.5.
- Bug #1721309: prevent bsddb module from freeing random memory.
- Bug #1686475: Support stat'
ing
open
files
on
Windows
again
.
...
...
Modules/Setup.dist
View file @
dc48b744
...
...
@@ -231,7 +231,6 @@ GLHACK=-Dclear=__GLclear
#audioop audioop.c # Operations on audio samples
#imageop imageop.c # Operations on images
#rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably)
# Note that the _md5 and _sha modules are normally only built if the
...
...
Modules/rgbimgmodule.c
deleted
100644 → 0
View file @
8d76cca0
This diff is collapsed.
Click to expand it.
README
View file @
dc48b744
...
...
@@ -294,7 +294,7 @@ Unix platforms: If your vendor still ships (and you still use) Berkeley DB
XXX I think this next bit is out of date:
64-bit platforms: The modules audioop,
imageop and rgbimg
don't work.
64-bit platforms: The modules audioop,
and imageop
don't work.
The setup.py script disables them on 64-bit installations.
Don't try to enable them in the Modules/Setup file. They
contain code that is quite wordsize sensitive. (If you have a
...
...
@@ -466,9 +466,9 @@ QNX: Chris Herborth (chrish@qnx.com) writes:
array, audioop, binascii, cPickle, cStringIO, cmath,
crypt, curses, errno, fcntl, gdbm, grp, imageop,
_locale, math, md5, new, operator, parser, pcre,
posix, pwd, readline, regex, reop, r
gbimg, r
otor,
posix, pwd, readline, regex, reop, rotor,
select, signal, socket, soundex, strop, struct,
syslog, termios, time, timing, zlib, audioop, imageop
, rgbimg
syslog, termios, time, timing, zlib, audioop, imageop
3) make SHELL=/usr/local/bin/bash
...
...
setup.py
View file @
dc48b744
...
...
@@ -508,10 +508,8 @@ class PyBuildExt(build_ext):
if sys.maxint != 9223372036854775807L:
# Operations on images
exts.append( Extension('imageop', ['imageop.c']) )
# Read SGI RGB image files (but coded portably)
exts.append( Extension('rgbimg', ['rgbimgmodule.c']) )
else:
missing.extend(['imageop'
, 'rgbimg'
])
missing.extend(['imageop'])
# readline
do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment