src/BloomExe/web/controllers/PageTemplatesApi.cs
/// <summary>
/// If there is no svg, then we assume that we are using a generated image.
/// If the book we want a thumbnail from is also the one we are currently editing,
/// then the thumbnail we generated last time might not reflect how the page is laid out
/// now. So in that case we ignore the existing png thumbnail (and any cached version
/// of it we previously saved) and make a new one. Bloom saves the current page
/// before invoking AddPage, so the file contains the right content for making the new one.
/// </summary>
If there is no svg, then we assume that we are using a generated image.
If the book we want a thumbnail from is also the one we are currently editing,
then the thumbnail we generated last time might not reflect how the page is laid out
now. So in that case we ignore the existing png thumbnail (and any cached version
of it we previously saved) and make a new one. Bloom saves the current page
before invoking AddPage, so the file contains the right content for making the new one.
If there is no svg then we assume that we are using a generated image . If the book we want a thumbnail from is also the one we are currently editing then the thumbnail we generated last time might not reflect how the page is laid out now . So in that case we ignore the existing png thumbnail ( and any cached version of it we previously saved ) and make a new one . Bloom saves the current page before invoking AddPage so the file contains the right content for making the new one .
private bool IsPageTypeFromCurrentBook(string localPath)
		{
			var testLocalPath = localPath.Replace ("/", "\\");
			var testFolderPath = _bookSelection.CurrentSelection.FolderPath.Replace ("/", "\\");
			if (Platform.IsWindows)
			{
				testLocalPath = testLocalPath.ToLowerInvariant();
				testFolderPath = testFolderPath.ToLowerInvariant();
			}
			return testLocalPath.Contains(testFolderPath);
		}
private bool IsPageTypeFromCurrentBook ( string localPath ) { var testLocalPath = localPath . Replace ( " " , " \\ " ) ; var testFolderPath = _bookSelection . CurrentSelection . FolderPath . Replace ( " " , " \\ " ) ; if ( Platform . IsWindows ) { testLocalPath = testLocalPath . ToLowerInvariant ( ) ; testFolderPath = testFolderPath . ToLowerInvariant ( ) ; } return testLocalPath . Contains ( testFolderPath ) ; }
If there is no svg, then we assume that we are using a generated image.
If there is no svg then we assume that we are using a generated image .
// Not a formality, since localPath comes from GetBookTemplatePaths and has been // forced to LC on Windows, while the book's FolderPath has not.
localPath
string