From d0ebb01c2fead87439ee362923be6cb1763383c0 Mon Sep 17 00:00:00 2001 From: maj00r Date: Thu, 15 Oct 2026 17:00:44 +0200 Subject: [PATCH] fix(editor): a blank standard orthophoto tile that the geoportal sent while it was busy is removed from the disk cache and fetched once more, instead of staying a black hole in the map for good --- editor/editorOrthophoto.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/editor/editorOrthophoto.cpp b/editor/editorOrthophoto.cpp index 8e606d74..1d692570 100644 --- a/editor/editorOrthophoto.cpp +++ b/editor/editorOrthophoto.cpp @@ -463,7 +463,17 @@ bool is_blank(image const &Image) bool load_standard(http_client &Client, tile_request const &Request, image &Out, std::string &Error, stop_check const &Stop) { std::vector data; - return fetch(Client, wms_url(Request, false, standard_pixels, false), cache_file(Request, false, std::to_string(standard_pixels) + ".jpg"), data, Error, Stop) && decode(data, Out, Error); + auto const path{cache_file(Request, false, std::to_string(standard_pixels) + ".jpg")}; + for (int attempt = 0; attempt < 2; ++attempt) + { + if (!fetch(Client, wms_url(Request, false, standard_pixels, false), path, data, Error, Stop) || !decode(data, Out, Error)) + return false; + if (!is_blank(Out)) + return true; + std::error_code ec; + fs::remove(path, ec); + } + return true; } // returns false on failure (to be retried later); Empty is set when the place has no imagery