Giter VIP home page Giter VIP logo

Comments (4)

lovasoa avatar lovasoa commented on June 6, 2024 1

Thank you @Boscop !
For google streetview images, I am not familiar with the format, but it looks like the kind of things that dezoomify-rs's generic dezoomer handles.

from serde-xml-rs.

oli-obk avatar oli-obk commented on June 6, 2024

I think this might be a duplicate of #3 .

This small example you have shown should definitely not require multiple GB of RAM

from serde-xml-rs.

lovasoa avatar lovasoa commented on June 6, 2024

@Boscop : Hello ! I know I am 3 years late, but I stumbled upon this issue, and it looks like you were trying to parse krpano description files in rust. I am the maintainer of dezoomify-rs, which also contains a (currently incomplete) implementation of the krpano xml format in rust. Can you tell a little bit more on what your project was at the time, and if you happen to still have an open-source implementation of a KRPano XML parser in rust ?

from serde-xml-rs.

Boscop avatar Boscop commented on June 6, 2024

@lovasoa Wow, I didn't know about dezoomify but it looks like a very cool project.
That project was about downloading 360° panorama/cubemap tiles and stitching them together, to be able to load them as cubemaps with glium like this.
I just looked at the code (that I haven't run since then, because I've been busy with other things, but at some point I might get back to it).
I vaguely remember that after I added explicit enum variants for all the cases that can occur, it worked.
These are the structs I ended up using, but they are incomplete as well, stuffing all the attributes into Vec<String>s. Feel free to use this & build on this:

#[derive(Debug, Deserialize)]
struct KrPano {
	#[serde(rename = "$value")]
	items: Vec<KrPanoItems>,
}

#[derive(Debug, Deserialize)]
#[allow(non_camel_case_types)]
enum KrPanoItems {
	panoview(Vec<String>),
	view(Vec<String>),
	autorotate(Vec<String>),
	image(Image),
	action(Vec<String>),
	layer(Vec<String>),
}

#[derive(Debug, Deserialize)]
struct Image {
	#[serde(rename = "type")]
	typ: String,
	multires: bool,
	right: Side,
	left: Side,
	up: Side,
	down: Side,
	front: Side,
	back: Side,
}

#[derive(Debug, Deserialize)]
struct Side {
	url: String,
}

Btw, could you add support for downloading tiles from google streetview panoramas? :)

Some example code here:
https://github.com/Jam3/extract-streetview
https://github.com/Jam3/google-panorama-tiles/blob/master/index.js

E.g.

curl https://lh3.ggpht.com/-g13kt2ekmi8/Vi2AaAydWgI/AAAAAAAAIZY/Md1XU4d_2echRCFXuSf0RQCO4MKDS-FxACJkC/x[0-11]-y[0-5]-z4/p -o tile_#2-#1.jpg
montage -mode concatenate -tile 12x6 tile*.jpg pano.png

But depending on the size, it needs to be cropped:

curl https://lh3.ggpht.com/-4RiMhWapOug/WUHkWYAWSoI/AAAAAAAAcHw/bmNgAVEQCK8JRQtaMRUfVBismGPUbB5_ACLIBGAYYCw/x[0-11]-y[0-5]-z4/p -o tile_#2-#1.jpg
montage -mode concatenate -tile 12x tile*.jpg pano.png
mogrify -crop 5000x2500+0+0 pano.png

from serde-xml-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.