Getting the original image from a scale

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:
http://path/to/item/image

So we can render the image with:
http:/path/to/item/@@images/image/some_scale

This would output as something like:
//path/to/item/@@images/f943af26-08.jpeg

SO: if I know only //path/to/item/@@images/f943af26-08.jpeg, is there any way I can know that the original image is:
http://path/to/item/image

does this help?

1 Like

Not really:
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
//path/to/item/@@images/f943af26-08.jpeg

comes from
//path/to/item/@@images/image/some_scale

and not:
//path/to/items/@@images/image2/another_scale.....

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.

1 Like

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.

1 Like

Thanks:
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