Thumbnail upload issue
Closed this issue · 1 comments
bieganowski commented
Expected Behavior
By saving the map, for the first time, it should be possible to upload a thumb
Actual Behavior
The new saved map does not have the thumb loaded
Steps to Reproduce the Problem
- Login as admin
- Click on Maps > Create Map
- From Options menu select Catalog > Add a layer
- From Options menu select Save as
- Insert a thumbnails and a Name
- Click on Save as
- Go back to Maps list
Specifications
- GeoNode version:
- Installation method (manual, GeoNode Docker, SPCGeoNode Docker):
- Platform:
- Additional details:
bieganowski commented
Issue is caused by two factors:
- the default thumbnail generation expects a thumbnail name to have
.png
extension. Loading any other file format and callingcreat_thumbnail
, even withoverwrite=False
(as in the case of Maps creation), causes regeneration of the thumbnail, since the generation script fails to recognize the thumbnail:geonode/geonode/thumbs/thumbnails.py
Line 100 in c1007fc
django-mapstore-adapter
first orders thumbnail saving, which triggers asynchronous task, which creates a default thumbnail:
https://github.com/GeoNode/geonode-mapstore-client/blob/6520cb78ceda6ce86ab7091f38c0e5ec86a3968d/mapstore2_adapter/plugins/serializers.py#L285
only to overwrite the thumbnail directly after it:
https://github.com/GeoNode/geonode-mapstore-client/blob/6520cb78ceda6ce86ab7091f38c0e5ec86a3968d/mapstore2_adapter/plugins/serializers.py#L298
Such an order of called function causes races in thumbnail creation, making it impossible to determine which thumbnail is assigned to a resource.