Пример #1
0
        internal void AssembleCollections (TagRepository tagRepository, PostRepository postRepository)
        {
            var dzc = new DeepZoomCollection (_settings);

            var tags = tagRepository.RetrieveTags ();
            foreach (var tag in tags)
            {
                var postIds = new List<int> (postRepository.RetrievePostIds (tag.Id));
                dzc.PivotizeTag (tag, postIds);
                dzc.CreateCollectionManifest (tag, postIds);
                dzc.CreateCollectionTiles (tag, postIds);
            }
        }
Пример #2
0
        internal static void AssembleCollections (Settings settings, TagRepository tagRepository, PostRepository postRepository)
        {
            var outputPath = Path.GetFullPath (OutputFolderName);

            var imageFormat = settings.PostImageEncoding;
            var imageFormatName = imageFormat.ToString ().ToLower ();
            var fileNameIdFormat = settings.FileNameIdFormat;
            var width = settings.ItemImageSize.Width;
            var height = settings.ItemImageSize.Height;

            var tags = tagRepository.RetrieveTags ();
            foreach (var tag in tags)
            {
                // TODO: consider using postIds, currently computed below
                PivotizeTag (postRepository, tag, settings);

                var postIds = new List<int> (postRepository.RetrievePostIds (tag.Id));

                var relativePathToCollectionManifest = Tag.ComputeBinnedPath (tag.Name, ".dzc");
                var absolutePathToCollectionManifest = Path.Combine (outputPath, relativePathToCollectionManifest);
                var relativePathToRoot = relativePathToCollectionManifest.RelativizePath ();

                CreateCollectionManifest (postIds, absolutePathToCollectionManifest, imageFormatName, relativePathToRoot,
                                          fileNameIdFormat, width, height);

                CreateCollectionTiles (tag, outputPath, postIds, imageFormat, fileNameIdFormat, outputPath);
            }
        }