Skip to content

Commit 58481e4

Browse files
committed
Clean up grammar and punctuation.
Move "Scaling `direction` to be deprecated in favor of `mode`" into an "attention" admonition, and change wording to be more clear about which form to use and when.
1 parent c76c786 commit 58481e4

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

docs/classic-ui/images.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ To get the scaling information only without creating an HTML tag, you can use th
6161
from plone import api
6262

6363
scale_util = api.content.get_view("images", context, request)
64-
# on the following line "leadimage" is the field name. The default Image content types field name is "image".
64+
# The default `Image` content type's field name is "image".
65+
# On the following line of code, "leadimage" is the field name.
6566
image_scale = scale_util.scale("leadimage", scale="mini")
6667
print(image_scale.url)
6768
print(image_scale.width)
@@ -97,7 +98,7 @@ You can directly create an HTML tag from `image_scale`:
9798
<img src="http://localhost:8080/Plone/news/newsitem1/@@images/9f676d46-0cb3-4512-a831-a5db4079bdfa.jpeg" alt="News Item 1!" title="News Item 1" height="21" width="32" srcset="http://localhost:8080/Plone/news/newsitem1/@@images/4a68513c-cffd-4de0-8a35-80627945b80f.jpeg 2x, http://localhost:8080/Plone/news/newsitem1/@@images/c32929c6-cb89-4ce7-846f-38adf29c09a4.jpeg 3x" />
9899
```
99100

100-
Instead of using the configured named scales you can also get an HTML tag with any specific size in pixels:
101+
Instead of using the configured named scales, you can get an HTML tag with any specific size in pixels:
101102

102103
```python
103104
from plone import api
@@ -109,11 +110,12 @@ tag = scale_util.scale("leadimage", width="600", height="200")
109110

110111
(classic-ui-images-scaling-direction-deprecated-in-favor-of-label)=
111112

112-
## Scaling `direction` deprecated in favor of `mode`
113+
## Scaling `direction` to be deprecated in favor of `mode`
113114

114-
The actual scaling is done in `plone.scale`.
115-
In Plone 6 in `plone.scale`, the `direction` argument is deprecated in favor of `mode`.
116-
The values should be converted as follows:
115+
```{attention}
116+
In the upcoming release of Plone 6.0, in `plone.scale` the `direction` argument will be deprecated in favor of `mode`.
117+
118+
`plone.scale` will continue to do scaling, but the values should be converted in your code as follows:
117119
118120
direction values | mode values
119121
-----------------|------------
@@ -124,13 +126,14 @@ up | cover
124126
keep | scale
125127
thumbnail | scale
126128
127-
For now `plone.namedfile` still expects the `direction` argument with the old values.
129+
Until the final release of Plone 6.0, continue to use `plone.namedfile` with the `direction` argument and its values.
130+
```
128131

129132

130133
(classic-ui-images-permissions-label)=
131134

132135
## Permissions
133136

134137
The `ImageScaling` view explicitly checks the permissions of the current user.
135-
To access image scales which are normally not accessible to the current user override the `validate_access` method in `plone.namedfile.scaling.ImageScale`.
138+
To access image scales, which are normally not accessible to the current user, override the `validate_access` method in `plone.namedfile.scaling.ImageScale`.
136139
In `Products.EasyNewsletter` you can find an example of that.

0 commit comments

Comments
 (0)