Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a8bcb4e8
Commit
a8bcb4e8
authored
Oct 28, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a patch to set width & height on PNG images.
parent
a005473b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+5
-3
No files found.
lib/python/OFS/Image.py
View file @
a8bcb4e8
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Image object"""
__version__
=
'$Revision: 1.8
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.8
7
$'
[
11
:
-
2
]
import
Globals
,
string
,
struct
,
content_types
from
OFS.content_types
import
guess_content_type
...
...
@@ -463,8 +463,10 @@ class Image(File):
# and finally the 4-byte width, height
elif
(
size
>=
24
)
and
(
data
[:
8
]
==
'
\
211
PNG
\
r
\
n
\
032
\
n
'
)
\
and
(
data
[
12
:
16
]
==
'IHDR'
):
w
,
h
=
struct
.
unpack
(
">LL"
,
data
[
16
:
24
])
w
,
h
=
struct
.
unpack
(
">LL"
,
data
[
16
:
24
])
self
.
width
=
str
(
int
(
w
))
self
.
height
=
str
(
int
(
h
))
# But we had this before. I have no clue, so I'll keep both. :)
# Maybe this is for an older PNG version.
elif
(
size
>=
16
)
and
(
data
[:
8
]
==
'
\
x89
PNG
\
r
\
n
\
x1a
\
n
'
):
...
...
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