OpenSceneGraph icon indicating copy to clipboard operation
OpenSceneGraph copied to clipboard

Storage issues arising from osgb format conversion

Open HerculesJL opened this issue 1 year ago • 5 comments

Hello, why is it that when I use osgconv to convert a model from osgb format to osgt format, and then convert it back to osgb format without making any changes, the storage space it occupies becomes very large?

HerculesJL avatar Jan 23 '24 07:01 HerculesJL

Please keep subject lines succinct, it's unhelpful to everyone to have put the whole question in the subject line.

As for why you model changes size, this is not normal behaviour. As we don't have information on the contents of the .osfb, .osgt or how the final .osgb grew there is no way of us knowing what might be going on,

robertosfield avatar Jan 23 '24 08:01 robertosfield

Thanks for your reply, and I am very sorry for my carelessness. The data is contained in Data.zip . InputOsgb is the original osgb, and convertedOsgb is the osgb converted from osgt. Data.zip

HerculesJL avatar Jan 23 '24 11:01 HerculesJL

By the way, if I want to change the name of osgb, Is there any other way besides converting osgb to osgt and then manually modifying the names of the LOD-related child nodes? Thanks again !

HerculesJL avatar Jan 23 '24 11:01 HerculesJL

The size increase is because you lost the jpeg compression on the image. This gets you closer: (jpeg re-compression) set OSG_OPTIMIZER=OFF osgconv -O WriteImageHint=WriteOut ..\InputOsgb.osgb out.osgt osgconv -O WriteImageHint=IncludeFile out.osgt out.osgb Cutting the jpeg data out of the osgb file with an hex editor gets you even closer, but I'm not aware of an option in osgconv to get it into a file directly.

LaurensVoerman avatar Jan 23 '24 13:01 LaurensVoerman

The size increase is because you lost the jpeg compression on the image. This gets you closer: (jpeg re-compression) set OSG_OPTIMIZER=OFF osgconv -O WriteImageHint=WriteOut ..\InputOsgb.osgb out.osgt osgconv -O WriteImageHint=IncludeFile out.osgt out.osgb Cutting the jpeg data out of the osgb file with an hex editor gets you even closer, but I'm not aware of an option in osgconv to get it into a file directly.

Thank you!

HerculesJL avatar Jan 23 '24 16:01 HerculesJL