Calling tile/@@images/image/preview works. But what about getting the original image, with tile/@@images/image?
For some custom tiles I have, this does not work, giving a NotFound error.
With the demo tile from demo.py this does work. Why? Because it has explicitly defined an image property and this makes it work. I did not know this was needed, and ideally it should not be. This PR fixes it to work both with and without such a property.
The @@download and @@display-file views did not work at all, also not for the demo tile. You get an Unauthorized because you are not allowed to access the image property. I tried fixing this with security declarations, but could not get it to work. This PR registers the two views specifically for persistent tiles, and makes them work by getting the image from the tile data. This works in both cases.
If this fails anyway, we fall back to the original code. I expect this gives an Unauthorized, but maybe someone has a tile where this is setup correctly.
Calling
tile/@@images/image/preview
works. But what about getting the original image, withtile/@@images/image
? For some custom tiles I have, this does not work, giving a NotFound error. With the demo tile fromdemo.py
this does work. Why? Because it has explicitly defined an image property and this makes it work. I did not know this was needed, and ideally it should not be. This PR fixes it to work both with and without such a property.The
@@download
and@@display-file
views did not work at all, also not for the demo tile. You get an Unauthorized because you are not allowed to access the image property. I tried fixing this with security declarations, but could not get it to work. This PR registers the two views specifically for persistent tiles, and makes them work by getting the image from the tile data. This works in both cases. If this fails anyway, we fall back to the original code. I expect this gives an Unauthorized, but maybe someone has a tile where this is setup correctly.I added tests to cover all uses.