After the Upgrade to Plone 6.0.7 i have sporadic errors with the display of image scales.
In a custom view, a request to the rest api get data with image scales, but the urls of the scales are not the same like under object_url/@@images-test
that is the url in the json-response:
object_url/@@images/image-1000-10b9ba6b46dbb9d211cc2818cd8cb8ad.jpeg
that is the url in the view object_url/@@images-test
:
object_url/@@images/image-1000-8edc3ba8410303e3087e84adf9291799
I'm not sure if this a catalog or caching problem. I must dive in.
The JSON Request to the API:
data = {
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.is",
"v": [
"News Item"
]
},
{
"i": "targetgroup",
"o": "plone.app.querystring.operation.selection.any",
"v": targetgroups
},
{
"i": "is_sticky",
"o": "plone.app.querystring.operation.boolean.isFalse",
"v": ""
}
],
"metadata_fields": ["effective", "CreatorFullname", "targetgroup", "getIcon", "image_scales"],
"sort_on": "effective",
"sort_order": "descending",
"fullobjects": false,
"limit": 30,
"b_start": 0,
"b_size": 30
};
const options = {
headers: {
Accept: "application/json",
},
credentials: "same-origin",
method: "GET"
};
const url = [
portal_url(),
"@querystring-search",
`?query=${encodeURIComponent(JSON.stringify(data))}`
].join("/");
Update
The catalog metadata image_scales
of the object are
{
'image': [
{
'filename': 'IMG20231012110047.jpg',
'content-type': 'image/jpeg',
'size': 51449,
'download': '@@images/image-1500-de2482e79d825d2a1d63c329d8f1d17c.jpeg',
'width': 1500,
'height': 844,
'scales': {
'great': {'download': '@@images/image-1200-bb9f04de22e0b10d8b9e42f5bfea3d78.jpeg', 'width': 1200, 'height': 675},
'larger': {'download': '@@images/image-1000-10b9ba6b46dbb9d211cc2818cd8cb8ad.jpeg', 'width': 1000, 'height': 562},
'large': {'download': '@@images/image-800-3cbde255eda0df1a8b5e5931c10baf2d.jpeg', 'width': 800, 'height': 450},
'teaser': {'download': '@@images/image-600-1329a9f94f32d28363c84bde16a86fc8.jpeg', 'width': 600, 'height': 337},
'preview': {'download': '@@images/image-400-ac2e48c0dbbebc20ebd4ba2dff0a7420.jpeg', 'width': 400, 'height': 225},
'mini': {'download': '@@images/image-200-440d85f6baa65eb81084c74f9c61e6a7.jpeg', 'width': 200, 'height': 112},
'thumb': {'download': '@@images/image-128-25aa4195eda69a60b7e881344d07ec39.jpeg', 'width': 128, 'height': 72},
'tile': {'download': '@@images/image-64-bc0ebc25a1230f15789349afe97739d4.jpeg', 'width': 64, 'height': 36},
'icon': {'download': '@@images/image-32-2ff5354bac7efccff81a422d34eedd34.jpeg', 'width': 32, 'height': 18},
'listing': {'download': '@@images/image-16-98802226b1e3d044cbcf888b02c803ed.jpeg', 'width': 16, 'height': 9}}
}
]
}
The stored scales info via '@@images-test' returns for the 1000px Image:
`data:`
`fieldname: image`
`height: 562`
`key: (('fieldname', 'image'), ('height', 65536), ('mode', 'scale'), ('scale', 'larger'), ('width', 1000))`
`mimetype: image/jpeg`
`modified: 1697799261158`
`srcset: []`
`uid: image-1000-8edc3ba8410303e3087e84adf9291799`
`width: 1000`
I'm not sure what are the connections between catalog and scales. Maybe @MrTango or @mauritsvanrees know more?
Update
Reindexing of Object helps, in the ZMI -> portal_catalog -> search the brain ->klick Update Button at the bottom