If I have the url of a SCALE of an image, is there a way to find the 'original' ?
Let say there is a News Item with an image:
So we can render the image with:
This would output as something like:
SO: if I know only //path/to/item/@
@images/f943af26-08.jpeg, is there any way I can know that the original image is:
does this help?
This file has been truncated.
.. admonition:: Description
How to programmatically manipulate images on your Plone site.
.. contents :: :local:
Plone supports image content in several forms:
stand-alone content type
As stand-alone content type, images will be visible in the sitemap.
This is the case for the default ``Image`` content type, but you can create custom content types with similar properties.
As long as I know the original items, I can find 'all kinds of stuff',
BUT: when I only know the rendered html (to be used with collective.lazysizes), I do not find any way of knowing that
If the 'scale itself had something to give me the name of the field, that would be 'enough' , for example if it had a method:
'getFieldName' that returned 'image' or 'myimagefield' etc.
the scale view multi adapter has a
getInfo method which gives you the UID, together with the extension from the mime type you can construct the name.
I have successfully managed to find it now, but with collective.lazysizes, I am now looking into another approach:
I would like the scale view to accept more paramethers (like if it is 'responsive / support for retina 1x 2x image etc).... Will look into it further
NB retina images just got approved for merge into core