Jump to content

Extension:StripExifGPSData/it

From mediawiki.org
This page is a translated version of the page Extension:StripExifGPSData and the translation is 27% complete.
Manuale sulle Estensioni MediaWiki
StripExifGPSData
Stato della release: stabile
Implementazione Interfaccia utente, Skin
Descrizione A MediaWiki extension that strips out Exif GPS data from images during the upload process.
Autore(i) Derf Jaggeddiscussione
Versione 1.11 (2025-07-08)
MediaWiki 1.35+
PHP 5.5+
Modifiche al Database No
Licenza MIT License
Scaricare

StripExifGPSData is a MediaWiki extension that strips out Exif GPS data from images during the upload process. This effectively removes any worry that users are uploading images that might leak their current or home location, as many cellphones or cameras automatically attach GPS coordinates to photos.

Setting $wgShowEXIF = false; in LocalSettings.php will disable metadata from being displayed in the File: page. However, the data still exists in the image itself, and that's where this extension comes in.

For reporting an issue or a bug, please open a GitHub issue.

Installazione

Requires MediaWiki 1.35 or higher.

  • Install the third-party tool exiftool on the OS and ensure "exiftool" is a valid command. This can be installed on a Linux distribution with the command:
    apt install libimage-exiftool-perl
  • {{$3|[[$2|Scarica]]|Scarica}} e sposta il/i file in una directory chiamata StripExifGPSData nella tua cartella extensions/.
  • Aggiungi il seguente codice al tuo $LocalSettings (preferibilmente alla fine):
    wfLoadExtension( 'StripExifGPSData' );
    
  • Yes Done – Naviga in Special:Version nella tua wiki per verificare che l'estensione sia stata installata correttamente.

Configurazione

You can optionally edit StripExifGPSData.php to change the line containing:

$cmd = "exiftool -overwrite_original -gps:all= " . escapeshellarg( $path );

to strip any desired metadata. For instance, to strip all metadata:

$cmd = "exiftool -overwrite_original -all= " . escapeshellarg( $path );

Documentation can be found on the exiftool website.

Note

  • You are not required to set $wgShowEXIF = false; to use this extension, but may be useful for your wiki.
  • Given that the GPS metadata is stripped after the image is uploaded, you may still see the original metadata-tagged image for some time if you have caching enabled.
  • This extension will not remove any metadata from images already on your wiki. To do this, you can use exiftool as described below.
    • To remove metadata from a single file:
      exiftool -gps:all= -overwrite_original /var/www/YOUR_SITE/wiki/images/a/bc/File_Containing_GPS_Info.jpg
    • To remove metadata from all files:
      exiftool -csv -filename -gps:GPSLatitude -gps:GPSLongitude /var/www/YOUR_SITE/wiki/images/ -r > ./output.csv
    Open the CSV, sort by GPSLatitude, then copy all filenames with GPS info to a file called input.txt and upload it to the server and run:
    tr -d '\r' < input.txt > cleanlist.txt && xargs -a cleanlist.txt exiftool -gps:all= -overwrite_original
    • Run php maintenance/refreshImageMetadata.php to update the metadata in the backend.