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
b9508698
Commit
b9508698
authored
Dec 20, 1996
by
Roger E. Masse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More and better comments.
parent
786c4bcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
Lib/test/test_imgfile.py
Lib/test/test_imgfile.py
+11
-4
No files found.
Lib/test/test_imgfile.py
View file @
b9508698
#! /usr/bin/env python
"""Simple test script for imgfile.c
Roger E. Masse
"""
from
test_support
import
verbose
import
imgfile
...
...
@@ -5,13 +9,16 @@ import imgfile
def
main
():
# Test a 3 byte color image
testimage
(
'test.rgb'
)
# Test a 1 byte greyscale image
testimage
(
'greytest.rgb'
)
def
testimage
(
name
):
"""
return a tuple consisting of
image (in 'imgfile' format) width, height, size
"""
Run through the imgfile's battery of possible methods
on the image passed in name.
"""
import
sys
...
...
@@ -22,8 +29,8 @@ def testimage(name):
# try opening the name directly
try
:
# This function returns a tuple (x, y, z) where x and y are the size
of
# the image in pixels and z is the number of bytes per pixel. Only
# This function returns a tuple (x, y, z) where x and y are the size
#
of
the image in pixels and z is the number of bytes per pixel. Only
# 3 byte RGB pixels and 1 byte greyscale pixels are supported.
sizes
=
imgfile
.
getsizes
(
name
)
except
imgfile
.
error
:
...
...
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