JPG to GLB Converter - Wrong Output

I try to convert jpg images into 3D Images. While I receive a file as a result its not the images that i uploaded. Its an images that contains the colors of the original image but not the patterns. It looks like aligned stripes.

What is going wrong in the process? Also it worked before.

Thank you for your help!
Jan Engel

1 Like

@janengel

Sorry for the inconvenience you are facing. Could you please share the problematic/source file with us along with the app link? We’ll further investigate this issue.

Hey, thank you for the quick reply. I cant upload .glb files here.

Therefore: CVAS9789BGR00-scaled-e1616183216637.glb - Google Drive

please compare it with the original jpg:

CVAS9789BGR00-scaled-e1616183216637.jpg (1,0 MB)

Thank you for your help!

@janengel
This issue is reproduced at our end. Therefore, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): THREEDAPP-2078

@janengel
Hi, this issue has been fixed, please kindly check it.
Thanks.

Perfect, thank you so much! Amazing support!

I would like to use this convertert in bulk for more than one file. Anyone in the community who can help me with building an API that does that for me?

@janengel
You can use our Aspose.3D to do this task:

Sample code:

            var imageFile = @"input.png";
            var glbFile = @"output.glb";
            //read image for retrieving it's size
            var bytes = System.IO.File.ReadAllBytes(imageFile);
            using var image = System.Drawing.Image.FromStream(new MemoryStream(bytes));

            //calculate the plane's size with the same ratio used in image.

            var planeWidth = 20.0f;
            var planeHeight = planeWidth / image.Height * image.Width;
            //create a plane with calculated size
            var p = new Aspose.ThreeD.Entities.Plane()
            {
                Width = planeWidth,
                Length = planeHeight
            };


            //create a material instance with texture
            var mat = new LambertMaterial();
            var tex = new Texture()
            {
                //read image file into memory so we can save it to glb later
                Content = bytes,
                FileName = Path.GetFileName(imageFile)
            };
            mat.SetTexture(Material.MapDiffuse, tex);

            //create a scene from plane and attach the material to the plane's node
            var scene = new Scene();
            scene.RootNode.CreateChildNode(p).Material = mat;
            //save scene into a GLB file and embed the image into the glb file.
            var opt = new GltfSaveOptions(FileContentType.Binary)
            {
                EmbedAssets = true
            };
            scene.Save(glbFile, opt);