Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# : dzi image creation #205

Closed
ErmaIsabel opened this issue Aug 27, 2013 · 3 comments
Closed

C# : dzi image creation #205

ErmaIsabel opened this issue Aug 27, 2013 · 3 comments

Comments

@ErmaIsabel
Copy link

I have an issue regarding the dzi image creation. I use the following code for dzi image generation in C#.

    public string GetGenetatedImage()
    {

        ImageCreator creator = new ImageCreator();

        creator.TileFormat = ImageFormat.Png;
        creator.TileOverlap = 1;
        creator.TileSize = 256;

        string RootPath = HttpContext.Current.Server.MapPath("~/Images/new.png");


        List<string> files = new List<string>()
        {               
           RootPath

        };
        string root = HttpContext.Current.Server.MapPath("~/Images/GeneratedImagesnewGrid/");


        List<string> dzi = new List<string>();
        foreach (var name in files)
        {
            string output = Path.Combine(root, Path.GetFileNameWithoutExtension(name) + ".dzi");
            dzi.Add(output);
            creator.Create(name, output);
        }

        CollectionCreator ccreator = new CollectionCreator();
        ccreator.TileFormat = ImageFormat.Png;
        ccreator.TileOverlap = 1;
        ccreator.TileSize = 256;
        ccreator.Create(dzi, Path.Combine(root, "da.dzc"));

        string rtvalue = HttpContext.Current.Server.MapPath("~/Images/GeneratedImagesLighthouse/newGrid.dzi");

        return rtvalue;

    }

I am using DeepZoomTools.

My input file is here, http://applicate.co.nz/opensea/image.html

Output i obtained, http://applicate.co.nz/opensea/indexgridnew.html

My output file seems to be having missing files. '

Client side code :

   OpenSeadragon({
                        id:             "example-zoomit-tilesource",
                        prefixUrl:       "openseadragon/images/",
                        defaultZoomLevel:        1,
                        minZoomLevel:         1,
                        maxZoomLevel:         3,
                        visibilityRatio:         0.3,
                        tileSources:   [{
                                        Image: {
                                                xmlns:    'http://schemas.microsoft.com/deepzoom/2008',
                                                Url:      "http://***.net/Content/img/GeneratedImagesnewGrid555/last5_files/",
                                                Format:   'png',
                                                Overlap:  "0", 
                                                TileSize: "256",
                                                ServerFormat: "Default",
                                        Size: { 
                                            Width: "5816",
                                            Height: "3961"
                                        }
                                               },


                                      },
                                 ]
                    });

Am i doing something wrong here? I cant find why my output has missing files.

Please help,
Thanks.

@iangilman
Copy link
Member

One thing I see is that you have overlap of 1 when creating and 0 when displaying. I don't know that that would cause the issue you're seeing, but still worth fixing.

@iangilman
Copy link
Member

Also, your input image http://applicate.co.nz/opensea/last5.png is 4800 x 8200, but you're using 5816 x 3961 for your output. Those need to match.

@ErmaIsabel
Copy link
Author

Got it working, changed the following code

creator.TileOverlap = 1;

to

creator.TileOverlap = 0;

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants