From 4ba4d36cd1e1bfbd133dda93b4f157c32079ea0e Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 23 Aug 2017 21:35:16 +0200 Subject: [PATCH] Added fixing of PDFs on upgrade to DBversion 37 --- Backend/BackendLoop.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Backend/BackendLoop.cs b/Backend/BackendLoop.cs index 95953375..ca62d904 100644 --- a/Backend/BackendLoop.cs +++ b/Backend/BackendLoop.cs @@ -47,8 +47,23 @@ namespace Swarmops.Backend // Checking for schemata upgrade first of all, after seeing that db exists + int startupDbVersion = Database.SwarmDb.DbVersion; + DatabaseMaintenance.UpgradeSchemata(); + if (startupDbVersion < 37) + { + // In versions below 37, there was a bug in the PDF rasterization + // (not in the database, we're just using the dbschema as a versioning + // tool) that requires re-rasterization of uploaded PDFs. Specifically, + // transparent-background PDFs were all black (black text on black bg). + + Console.WriteLine("We need to regenerate all bitmaps from vector PDFs because of a now-fixed bug."); + Console.WriteLine("This will take a few hours, but only needs to be done once."); + + PdfProcessor.RegenerateAll(); + } + testMode = false; SystemSettings.BackendHostname = Dns.GetHostName();