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
793edb8b
Commit
793edb8b
authored
Aug 24, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged new defaults for alt and border attrs
parent
ba536eed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
24 deletions
+15
-24
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+15
-24
No files found.
lib/python/OFS/Image.py
View file @
793edb8b
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Image object"""
__version__
=
'$Revision: 1.11
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.11
5
$'
[
11
:
-
2
]
import
Globals
,
string
,
struct
,
content_types
from
OFS.content_types
import
guess_content_type
...
...
@@ -239,13 +239,6 @@ class File(Persistent,Implicit,PropertyManager,
data
=
data
.
next
return
''
def
__call__
(
self
):
# allow publisher to call the object directly - this lets File
# and Image objects act as the default document if they want.
request
=
self
.
REQUEST
response
=
request
.
RESPONSE
return
self
.
index_html
(
request
,
response
)
def
view_image_or_file
(
self
,
URL1
):
"""
...
...
@@ -561,12 +554,7 @@ class Image(File):
def
__str__
(
self
):
width
=
self
.
width
and
(
'width="%s" '
%
self
.
width
)
or
''
height
=
self
.
height
and
(
'height="%s" '
%
self
.
height
)
or
''
return
'<img src="%s" %s%salt="%s">'
%
(
self
.
absolute_url
(),
width
,
height
,
self
.
title_or_id
()
)
return
self
.
tag
()
def
tag
(
self
,
height
=
None
,
width
=
None
,
alt
=
None
,
scale
=
0
,
xscale
=
0
,
yscale
=
0
,
**
args
):
...
...
@@ -585,29 +573,32 @@ class Image(File):
# Auto-scaling support
xdelta
=
xscale
or
scale
ydelta
=
yscale
or
scale
if
xdelta
and
width
!=
None
:
if
xdelta
and
width
:
width
=
str
(
int
(
width
)
*
xdelta
)
if
ydelta
and
height
!=
None
:
if
ydelta
and
height
:
height
=
str
(
int
(
height
)
*
ydelta
)
string
=
'<img src="%s"'
%
(
self
.
absolute_url
())
result
=
'<img src="%s"'
%
(
self
.
absolute_url
())
if
alt
is
None
:
alt
=
self
.
title_or_id
()
if
alt
:
string
=
'%s alt="%s"'
%
(
string
,
alt
)
alt
=
getattr
(
self
,
'title'
,
''
)
result
=
'%s alt="%s"'
%
(
result
,
alt
)
if
height
:
string
=
'%s height="%s"'
%
(
string
,
height
)
result
=
'%s height="%s"'
%
(
result
,
height
)
if
width
:
string
=
'%s width="%s"'
%
(
string
,
width
)
result
=
'%s width="%s"'
%
(
result
,
width
)
if
not
'border'
in
map
(
string
.
lower
,
args
.
keys
()):
result
=
'%s border="0"'
%
result
for
key
in
args
.
keys
():
value
=
args
.
get
(
key
)
string
=
'%s %s="%s"'
%
(
string
,
key
,
value
)
result
=
'%s %s="%s"'
%
(
result
,
key
,
value
)
return
string
+
'>'
return
'%s>'
%
result
def
cookId
(
id
,
title
,
file
):
...
...
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