You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -353,17 +353,17 @@ The inline upgrade to Plone will replace the two versions of the old behavior wi
353
353
Within the Plone code base there are circular dependencies.
354
354
Package A uses package B and package B uses package A.
355
355
Specifically, `Products.CMFPlone` is the main package of Plone where everything comes together.
356
-
It depends on a lot of Plone packages.
356
+
`Products.CMFPlone` depends on a lot of Plone packages.
357
357
But these packages often import code from `Products.CMFPlone`.
358
-
This is done in such a way that it works, but it creates an unclear situation and makes it hard to debug errors when there is an error in this implicit dependency chain.
358
+
This is done in such a way that it works, but it creates an unclear situation and makes it hard to debug errors when they occur in this implicit dependency chain.
359
359
360
360
The solution in Plone 6.0 was to create a package called `plone.base`.
361
361
Some often used code from `Products.CMFPlone` and other packages was moved here.
362
362
Backwards compatibility imports were kept in place, so this should not cause any breakage in add-ons.
363
363
You *will* get warnings in your logs, unless you have silenced them.
364
364
For example when your code has `from Products.CMFPlone.utils import base_hasattr` you will see:
365
365
366
-
```
366
+
```console
367
367
DeprecationWarning: base_hasattr is deprecated.
368
368
Import from plone.base.utils instead (will be removed in Plone 7)
369
369
```
@@ -394,9 +394,9 @@ except ImportError:
394
394
395
395
## Support for modern image scales
396
396
397
-
In Plone 5.2 these image scales were available, with scale name, width and height:
397
+
In Plone 5.2 the following image scales were available, with scale name, width, and height:
398
398
399
-
```
399
+
```text
400
400
large 768:768
401
401
preview 400:400
402
402
mini 200:200
@@ -408,7 +408,7 @@ listing 16:16
408
408
409
409
Plone 6.0 changes them:
410
410
411
-
```
411
+
```text
412
412
huge 1600:65536
413
413
great 1200:65536
414
414
larger 1000:65536
@@ -423,14 +423,14 @@ listing 16:16
423
423
```
424
424
425
425
- The biggest scale now has a width of 1600 instead of 768.
426
-
- The 'large' scale was made slightly bigger: from 768 to 800.
427
-
- All scales above 'mini' have a height of 65536.
426
+
- The `large` scale was made slightly bigger: from 768 to 800.
427
+
- All scales above `mini` have a height of 65536.
428
428
This does not mean you get an extremely high image.
429
429
It means only the width is taken into account when resizing the image.
430
430
This is a better fit for most modern themes.
431
431
432
432
```{note}
433
-
The standard Plone upgrade only adds the completely new scales: huge, great, larger, teaser.
433
+
The standard Plone upgrade only adds the completely new scales: `huge`, `great`, `larger`, and `teaser`.
434
434
It leaves the other scales untouched.
435
435
This is to avoid strange differences between old and new images.
436
436
For example, old images would otherwise have a large scale with width 768, where for new images this would be width 800.
@@ -443,29 +443,29 @@ For example, old images would otherwise have a large scale with width 768, where
443
443
444
444
(v60-pre-scaling-label)=
445
445
446
-
## Image prescaling
446
+
## Image pre-scaling
447
447
448
-
In Plone 6, we have made a split between generating a url for an image scale and actually scaling the image.
448
+
In Plone 6, we have made a split between generating a URL for an image scale and actually scaling the image.
449
449
Why would you want this?
450
450
451
-
As an add-on author you create a template and you want to show an uploaded image with the preview scale.
451
+
As an add-on author, you create a template and you want to show an uploaded image with the preview scale.
In Plone 5 this creates a scale of the image, using the Pillow imaging library.
460
460
In Plone 6, the scaled image is not yet created at this point.
461
-
The scaled image is only created when (if) the browser actually requests the image.
461
+
The scaled image is only created when the browser actually requests the image.
462
462
463
463
This is good, because for various reasons, the browser may never actually ask for this scaled image.
464
464
For example, the browser may be on a mobile phone with the images turned off to prevent using costly band width.
465
465
Also, when the tag contains source sets for HiDPI or picture variants, the browser may see five possible images and only choose to download one of them.
466
466
467
-
In Plone 6, when generating a tag forin this case the preview scale, a unique url is generated, and information for this scale is pre-registered.
468
-
Only when the browser requests the scaled image at this url, does Plone generate the scale.
467
+
In Plone 6, when generating a tag for, as in this case, the `preview` scale, a unique URL is generated, and information for this scale is pre-registered.
468
+
Only when the browser requests the scaled image at this URL, does Plone generate the scale.
469
469
This avoids generating image scales that never get used.
470
470
471
471
This performance improvement makes two other image improvements possible.
@@ -491,7 +491,7 @@ Alternatively, you can explicitly use the new `pre` argument, but this will fail
491
491
492
492
```{note}
493
493
There now is an image test page that shows several scales of an image, in various modes.
494
-
In your browser to to an image and add `/@@images-test` to the end of the url.
494
+
In your browser, go to an image, and add `/@@images-test` to the end of the URL.
495
495
```
496
496
497
497
```{seealso}
@@ -522,23 +522,26 @@ But if you want to use the responsive image support, you should use the `picture
522
522
523
523
## Store image scale info in catalog metadata
524
524
525
-
When you add or edit an image, Plone 6 pre-registers all scales and stores info about them in the portal catalog.
526
-
The catalog brain of an image then has all the needed information about each scale, especially the unique url and the width and height.
527
-
This is used on lists of images to be able show a scale in a tag without waking up the image objects from the database.
528
-
In other words: this speeds up pages that contain lots of images.
525
+
When you add or edit an image, Plone 6 pre-registers all scales and stores information about them in the portal catalog.
526
+
The catalog brain of an image then has all the needed information about each scale, especially the unique URL, width, and height.
527
+
This is used on lists of images to be able to show a scale in a tag without waking up the image objects from the database.
528
+
In other words, this speeds up pages that contain lots of images.
529
529
530
-
Add-on authors do not have to change anything: this happens automatically.
530
+
Add-on authors do not have to change anything, as this happens automatically.
531
531
If you have a very special use case, you can influence this with some new adapters.
532
532
533
533
```{note}
534
-
When upgrading your Plone Site to Plone 6.0, the inline migration finds all images in your site.
534
+
When upgrading your Plone Site to Plone 6.0, the in-place migration finds all images in your site.
535
535
It then adds the scale information to the catalog.
536
536
This may take a long time.
537
537
You can disable this with an environment variable:
538
-
`export UPDATE_CATALOG_FOR_IMAGE_SCALES=0`
539
-
In that case, you are advised to add the `image_scales` column manually to the catalog later.
538
+
539
+
```shell
540
+
export UPDATE_CATALOG_FOR_IMAGE_SCALES=0
540
541
```
541
542
543
+
In that case, you are advised to add the `image_scales` column manually to the catalog later.
0 commit comments