GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.43k stars 1.12k forks source link

Bad thumbnail handling #12423

Open etj opened 1 month ago

etj commented 1 month ago

Expected Behavior

Actual Behavior

When a Document is created, two files are created, e.g.:

-rw-r--r-- 1 root root 17135 Jul 16 07:11 document-886bda39-8560-40b2-b9a0-66104147b254-thumb-e5a132a7-57b7-43d2-bcf0-52d4af6fe3e0.jpg
-rw-r--r-- 1 root root 17135 Jul 16 07:11 document-886bda39-8560-40b2-b9a0-66104147b254-thumb-e5a132a7-57b7-43d2-bcf0-52d4af6fe3e0_3ClS2qX.jpg

When the Document is removed, the files are kept.

Other Resource types should be checked.

Steps to Reproduce the Problem

  1. Create a Document
  2. Check the thumbnail dir for files containing the resource UUID
  3. Remove the Document
  4. Check if the files still exist (they do)

Specifications

mattiagiupponi commented 1 month ago

The thumb is saved twice. The first time here: https://github.com/GeoNode/geonode/blob/4b6d872682ef0efd1ae61bf515b1f7d2250ba448/geonode/base/models.py#L1555

Then again after cropping:

https://github.com/GeoNode/geonode/blob/4b6d872682ef0efd1ae61bf515b1f7d2250ba448/geonode/base/models.py#L1574-L1576

This is valid for all the resources not only documents. Still to be analyzed why is not deleted